Language: C++



int main() {

  ll n;
  cin>>n;
  
  ll sum=0;
  ll nori=0;
  ll nole=0;
  ll noll=0;
  ll x,sma; 
  
  rep(i,n){
  string s;
  cin>>s;
  ll n=s.size();
  x=0;
  sma=5000000;  
    rep(j,n){
      if(s[j]=='(') x++;
      else x--;
      sma=min(sma,x);
    }
    if(sma<0) nole++;
    if(sma-x<0) nori++;
    if(sma<0 && sma-x<0) noll++;
  sum+=x;
  }  
  
  if(sum!=0) {
  cout << "No" << endl;
  return 0;
  }
  
  if(n==1 && (nole>0 || nori>0)) {
  cout << "No" << endl;
  return 0;  
  }
  
  if(nole==n || nori==n || noll>=n-1) {
  cout << "No" << endl;
  return 0;  
  }
  
  cout << "Yes" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
    5 |   ll n;
      |   ^~
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n;
      |   ^~~
a.cc:6:8: error: 'n' was not declared in this scope
    6 |   cin>>n;
      |        ^
a.cc:8:5: error: expected ';' before 'sum'
    8 |   ll sum=0;
      |     ^~~~
      |     ;
a.cc:9:5: error: expected ';' before 'nori'
    9 |   ll nori=0;
      |     ^~~~~
      |     ;
a.cc:10:5: error: expected ';' before 'nole'
   10 |   ll nole=0;
      |     ^~~~~
      |     ;
a.cc:11:5: error: expected ';' before 'noll'
   11 |   ll noll=0;
      |     ^~~~~
      |     ;
a.cc:12:5: error: expected ';' before 'x'
   12 |   ll x,sma;
      |     ^~
      |     ;
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   rep(i,n){
      |       ^
a.cc:14:3: error: 'rep' was not declared in this scope
   14 |   rep(i,n){
      |   ^~~
a.cc:31:6: error: 'sum' was not declared in this scope
   31 |   if(sum!=0) {
      |      ^~~
a.cc:32:3: error: 'cout' was not declared in this scope
   32 |   cout << "No" << endl;
      |   ^~~~
a.cc:32:19: error: 'endl' was not declared in this scope
   32 |   cout << "No" << endl;
      |                   ^~~~
a.cc:36:15: error: 'nole' was not declared in this scope
   36 |   if(n==1 && (nole>0 || nori>0)) {
      |               ^~~~
a.cc:36:25: error: 'nori' was not declared in this scope
   36 |   if(n==1 && (nole>0 || nori>0)) {
      |                         ^~~~
a.cc:37:3: error: 'cout' was not declared in this scope
   37 |   cout << "No" << endl;
      |   ^~~~
a.cc:37:19: error: 'endl' was not declared in this scope
   37 |   cout << "No" << endl;
      |                   ^~~~
a.cc:41:6: error: 'nole' was not declared in this scope
   41 |   if(nole==n || nori==n || noll>=n-1) {
      |      ^~~~
a.cc:41:17: error: 'nori' was not declared in this scope
   41 |   if(nole==n || nori==n || noll>=n-1) {
      |                 ^~~~
a.cc:41:28: error: 'noll' was not declared in this scope
   41 |   if(nole==n || nori==n || noll>=n-1) {
      |                            ^~~~
a.cc:42:3: error: 'cout' was not declared in this scope
   42 |   cout << "No" << endl;
      |   ^~~~
a.cc:42:19: error: 'endl' was not declared in this scope
   42 |   cout << "No" << endl;
      |                   ^~~~
a.cc:46:3: error: 'cout' was not declared in this scope
   46 |   cout << "Yes" << endl;
      |   ^~~~
a.cc:46:20: error: 'endl' was not declared in this scope
   46 |   cout << "Yes" << endl;
      |                    ^~~~