1 solutions
-
1
#include<bits/stdc++.h> using namespace std; stack<char> stk; int main() { string str; cin>>str; for(int i=0;i<str.size();i++) { if(str[i]=='@') break; if(str[i]=='(') stk.push(str[i]); if(str[i]==')') { if(stk.size()==0) { cout<<"NO"; return 0; } else { stk.pop(); } } } if(stk.size()) cout<<"NO"; else { cout<<"YES"; } return 0; }
- 1
Information
- ID
- 140
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- # Submissions
- 60
- Accepted
- 17
- Uploaded By