Codeforces 1411A/1465A - In-game Chat Solution
Solution in C++:
///**********ALLAH IS ALMIGHTY************///
///AH Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int l,i,n,t,c;
- string s;
- cin>>t;
- while(t--)
- {
- c=0;
- cin>>n;
- cin>>s;
- for(i=n-1;i>=0;i--)
- {
- if(s[i]==')')
- c++;
- else
- break;
- }
- if(c*2>n)
- cout<<"Yes"<<endl;
- else
- cout<<"No"<<endl;
- }
- }
No comments