SHARE
TWEET

Untitled

a guest Mar 26th, 2020 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. long long a,b,c,i,h,j,g,f;
  5. string s,d;
  6. int main()
  7. {
  8.     cin>>s;
  9.     for(i=1;i<s.length();i++){
  10.         if(s[i]=='(')f++;
  11.         else f--;
  12.         if(c<0)g=1;}
  13.     if(g==0&&f==0)cout<<"YES"<<endl;
  14.     else cout<<"NO"<<endl;
  15.     return 0;
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top