| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 117023 | 陈家宝 | 表达式括号匹配2 | C++ | Accepted | 100 | 0 MS | 260 KB | 308 | 2023-12-21 13:54:40 |
#include<bits/stdc++.h> using namespace std; string s; int m; int main(){ cin>>s; for(int i=0;i<s.size();i++){ if(s[i]=='(') m++; else if(s[i]==')'){ if(m==0){ cout<<"Wrong"; return 0; } else m--; } } if(m==0)cout<<"YES"; else cout<<"NO"; return 0; }