Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- long long a,b,c,i,h,j,g,f;
- string s,d;
- int main()
- {
- cin>>s;
- for(i=1;i<s.length();i++){
- if(s[i]=='(')f++;
- else f--;
- if(c<0)g=1;}
- if(g==0&&f==0)cout<<"YES"<<endl;
- else cout<<"NO"<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement