criyle/codenet-compile-errors huggingface dataset:
Language: C++

/*
 * @Author: Kaizyn
 * @Date: 2020-05-10 19:57:14
 * @LastEditTime: 2020-05-10 21:34:13
 */
#include <bits/stdc++.h>

// #define DEBUG

using namespace std;

const double eps = 1e-7;
const double PI = acos(-1);
typedef pair<int, int> pii;
const int MOD = 998244353;
const int INF = 0x3f3f3f3f;
const int N = 1e6+7;

int n;
int minv[N], endv[N];
string s[N];
vector<int> neg, pos;

inline void solve() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> s[i];
  int sum = 0, val = 0;
  for (int i = 1; i <= n; ++i) {
    for (const char &c : s[i]) {
      endv[i] += (c == '(' ? 1 : -1);
      minv[i] = min(minv[i], v);
    }
    sum += endv[i];
    if (minv[i] >= 0) {
      val += endv[i];
    } else if (endv[i] >= 0) {
      pos.emplace_back(i);
    } else if (minv[i] < endv[i]) {
      neg.emplace_back(i);
    }
  }
  if (sum != 0) return void(cout << "No" << endl);
  sort(pos.begin(), pos.end(), [&](const int &x, const int &y) {
      return minv[x] > minv[y];
  });
  for (const int &i : pos) {
    if (val < -minv[i]) return void(cout << "No" << endl);
    val += endv[i];
  }
  sort(neg.begin(), neg.end(), [&](const int &x, const int &y) {
      return minv[x] < minv[y];
  });
  for (const int &i : neg) {
    if (val < -minv[i]) return void(cout << "No" << endl);
    val += endv[i];
  }
  cout << "Yes" << endl;
}

signed main() {
  ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  int T = 1;
  // cin >> T;
  for (int t = 1; t <= T; ++t) {
    solve();
  }
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:31:30: error: 'v' was not declared in this scope
   31 |       minv[i] = min(minv[i], v);
      |                              ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <functional>
using i64 = long long;

int main() {
    int n;
    std::cin >> n;
    std::vector<std::pair<int, int>> pos, neg;

    int total = 0;
    for (int i = 0; i < n; i++) {
        std::string s;
        std::cin >> s;
        int sum = 0, min = 0;
        for (auto c : s) {
            if (c == '(') sum++;
            else sum--;
            if (min > sum) min = sum;
        }
        total += sum;
        if (sum >= 0) pos.emplace_back(sum, min);
        else neg.emplace_back(sum, min);
    }

    if (total) {
        std::cout << "No" << std::endl;
        return 0;
    }

    std::sort(pos.begin(), pos.end(), [](const auto &lhs, const auto &rhs) {
        return lhs.second < rhs.second ||
            (lhs.second == rhs.second && lhs.first > rhs.first);
    });
    std::sort(v.begin(), v.end(), [](const auto &lhs, const auto &rhs) {
        const auto l = lhs.first - lhs.second, r = rhs.first - rhs.second;
        return l > r || (l == r && lhs.first > rhs.first);
    });

    for (const auto [sum, min] : pos) {
        if (total + min < 0) {
            std::cout << "No" << std::endl;
            return 0;
        }
        total += sum;
    }

    for (const auto [sum, min] : neg) {
        if (total + min < 0) {
            std::cout << "No" << std::endl;
            return 0;
        }
        total += sum;
    }

    std::cout << "Yes" << std::endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   33 |     std::sort(pos.begin(), pos.end(), [](const auto &lhs, const auto &rhs) {
      |          ^~~~
      |          qsort
a.cc:37:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   37 |     std::sort(v.begin(), v.end(), [](const auto &lhs, const auto &rhs) {
      |          ^~~~
      |          qsort
a.cc:37:15: error: 'v' was not declared in this scope
   37 |     std::sort(v.begin(), v.end(), [](const auto &lhs, const auto &rhs) {
      |               ^
Language: C++

#include <iostream>
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    int S;
    cin >> S;

    pair<string,int> brackets;
    std::vector<pair<int,int>> offsets;
    bool opening = false;
    for(int i = 0; i < S; ++i){
        string s;
        cin >> s;
        pair<int,int> eff(0,0);
        for(int j = 0; j < s.size(); ++j) {
            if(s[j]==')'){
                if(eff.second == 0){
                    eff.first++;
                }else{
                    eff.second--;
                }
            }else{
                eff.second++;
            }
        }
        if(eff.second != 0 && eff.first == 0){
            opening = true;
        }
        if(eff.first!=0||eff.second!=0){
            offsets.push_back(eff);
        }
    }

    if(!opening){
        cout << "No";
        return 0;
    }
    sort(&offsets[0],&offsets[offsets.size()-1] ,[](const pair<int,int> &p1 ,const pair<int,int> &p2){
        return p2.first>p1.first;
    });

    long openBrackets = 0;
    for(int i = 0; i < offsets.size(); ++i){
        openBrackets += offsets[i].second-offsets[i].first;
    }
    if(!openBrackets){
        cout << "Yes";
    }else{
        cout << "No";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'vector' is not a member of 'std'
   10 |     std::vector<pair<int,int>> offsets;
      |          ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:10:29: error: expected primary-expression before '>' token
   10 |     std::vector<pair<int,int>> offsets;
      |                             ^~
a.cc:10:32: error: 'offsets' was not declared in this scope; did you mean 'offsetof'?
   10 |     std::vector<pair<int,int>> offsets;
      |                                ^~~~~~~
      |                                offsetof
a.cc:39:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   39 |     sort(&offsets[0],&offsets[offsets.size()-1] ,[](const pair<int,int> &p1 ,const pair<int,int> &p2){
      |     ^~~~
      |     short
Language: C++

#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"

typedef pair<int,int> PII;
typedef pair<int,string> PIS;
typedef pair<string,int> PSI;


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  pair<PII,string> v[n];
  rep(i,n){
    cin>>v[i].S;
    v[i].F.S=0;
    int num=0;
    rep(j,v[i].S.size() ){
      if(v[i].S[j]=='(') num--;
      else num++;
      if(num>0) v[i].F.S=1;
    }
    v[i].F.F=num;
  }
  sort(v,v+n);
 
  int num=0;
  rep(i,n){
    rep(j,v[i].S.size() ){
      if(v[i].F.S==0){
	if(v[i].S[j]=='(') num--;
	else num++;
	if(num>0){
	  cout<<"No"<<endl;
	  return 0;
	}
      }
    }
  }
  rep(i,n){
    rep(j,v[i].S.size() ){
      if(v[i].F.S==1){
	if(v[i].S[j]=='(') num--;
	else num++;
	if(num>0){
	  cout<<"No"<<endl;
	  return 0;
	}
      }
    }
  }
  if(num==0) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  
  

  return 0;
}


Compiler output:
a.cc:8:9: error: 'pair' does not name a type
    8 | typedef pair<int,int> PII;
      |         ^~~~
a.cc:9:9: error: 'pair' does not name a type
    9 | typedef pair<int,string> PIS;
      |         ^~~~
a.cc:10:9: error: 'pair' does not name a type
   10 | typedef pair<string,int> PSI;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:14:3: error: 'cin' was not declared in this scope
   14 |   cin.tie(0);
      |   ^~~
a.cc:15:3: error: 'ios' has not been declared
   15 |   ios::sync_with_stdio(false);
      |   ^~~
a.cc:18:3: error: 'pair' was not declared in this scope
   18 |   pair<PII,string> v[n];
      |   ^~~~
a.cc:18:8: error: 'PII' was not declared in this scope
   18 |   pair<PII,string> v[n];
      |        ^~~
a.cc:18:12: error: 'string' was not declared in this scope
   18 |   pair<PII,string> v[n];
      |            ^~~~~~
a.cc:18:20: error: 'v' was not declared in this scope
   18 |   pair<PII,string> v[n];
      |                    ^
a.cc:30:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   30 |   sort(v,v+n);
      |   ^~~~
      |   short
a.cc:39:11: error: 'cout' was not declared in this scope
   39 |           cout<<"No"<<endl;
      |           ^~~~
a.cc:51:11: error: 'cout' was not declared in this scope
   51 |           cout<<"No"<<endl;
      |           ^~~~
a.cc:57:14: error: 'cout' was not declared in this scope
   57 |   if(num==0) cout<<"Yes"<<endl;
      |              ^~~~
a.cc:58:8: error: 'cout' was not declared in this scope
   58 |   else cout<<"No"<<endl;
      |        ^~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
class kuohao{
    public:
    int must_have=0;
    int this_num=0;
    bool operator<(const kuohao& a){
        return (this->must_have)<(a.must_have);
    }
};
int main(){
    int n;
    std::cin>>n;
    std::string strs[n];
    kuohao k[n];
    bool b[n];
    for(int i=0;i<n;++i){
        std::cin>>strs[i];
        b[i]=false;
    }
    for(int i=0;i<n;++i){
        int temp=strs[i].size(); 
        int count=0;
        int countMH=0;
        for(int j=0;j<temp;++j){
            if(strs[i][j]=='('){
                ++count;
            }
            if(strs[i][j]==')'){
                --count;
            }
            if(count<countMH){
                ++(k[i].must_have);
                countMH=count;
            }
        }
        k[i].this_num=count;
    }
    std::sort(k,k+n);
    int count=0;
    for(int i=n-1;i>=0;--i){
        if(count>=k[i].must_have&&!(b[i])){
            int max=0;
            for(int j=0;j<i;++j){
                if(k[j].this_num>k[max].this_num){
                    max=k;
                }
            }
            count+=k[max].this_num;
            b[max]=true;
        }
        i=0;
        for(int l=0;l<n;++l){
            if(!b[l]){
                i=n-1;
            }
            break;
        }
    }
    if(count==0){
        std::cout<<"YES"<<std::endl;
    }
    else{
        std::cout<<"NO"<<std::endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:25: error: invalid conversion from 'kuohao*' to 'int' [-fpermissive]
   47 |                     max=k;
      |                         ^
      |                         |
      |                         kuohao*
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
  ll n,cnt=0;
  cin>>n;
  for(ll i=0;i<n;i++)
  {
    string a;
    cin>>a;
    for(ll i=0;i<a.size();i++)
    {
      if(a[i]=='(')
        cnt++;
      else
        cnt--;
    }

  }
  if(cnt==0)
      cout<<"Yes";
    else
    {
      if(n==1)
      { 
        if(a[0]=')')
          cout<<"No\n";
        else
          cout<<"Yes";
      }
      else
        "No";
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: 'a' was not declared in this scope
   27 |         if(a[0]=')')
      |            ^
Language: C++

int main() {
    int n;
    int lbr = 0, rbr = 0, sum = 0;

    std::string str;

    std::cin >> n;

    for (int i = 0; i < n; i++) {
        std::cin >> str;

        sum += str.size();

        for (auto && e : str) {
            if (e == '(') lbr++;
        }
    }

    if (lbr == sum / 2) std::cout << "Yes" << std::endl;
    else                std::cout << "No"  << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'string' is not a member of 'std'
    5 |     std::string str;
      |          ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | int main() {
a.cc:7:10: error: 'cin' is not a member of 'std'
    7 |     std::cin >> n;
      |          ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main() {
a.cc:10:14: error: 'cin' is not a member of 'std'
   10 |         std::cin >> str;
      |              ^~~
a.cc:10:14: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:21: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |         std::cin >> str;
      |                     ^~~
      |                     std
a.cc:19:30: error: 'cout' is not a member of 'std'
   19 |     if (lbr == sum / 2) std::cout << "Yes" << std::endl;
      |                              ^~~~
a.cc:19:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:52: error: 'endl' is not a member of 'std'
   19 |     if (lbr == sum / 2) std::cout << "Yes" << std::endl;
      |                                                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main() {
a.cc:20:30: error: 'cout' is not a member of 'std'
   20 |     else                std::cout << "No"  << std::endl;
      |                              ^~~~
a.cc:20:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:52: error: 'endl' is not a member of 'std'
   20 |     else                std::cout << "No"  << std::endl;
      |                                                    ^~~~
a.cc:20:52: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,a,b,A,B;
string s;
vector<pair<int,int> >v;
int main()
{
    cin>>n;
    while(n--)
    {
        cin>>s;
        int l=0,r=0;
        for(int i=0;i<s.size();i++)
            if(s[i]=='(') r++;
        else
        {
            if(r) r--;
            else l++;
        }
        if(l&&r) v.push_back({r,l}),a+=l,b+=r;
        else if(l) A+=l;
        else if(r) B+=r;
    }
    if(B+b!=A+l)
    {
        printf("No\n");return 0;
    }
    bool flag=false;
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++)
    {
        pair<int,int>x=v[i];
        int r=x.first,l=x.second,la=a-l,lb=b-r;
        if(l>B) continue;
        int xx=r+lb-la-(B-l),yy=min(A,r+lb-la);
        //cout<<l<<' '<<r<<' '<<xx<<' '<<yy<<' '<<la<<' '<<lb<<endl;
        int pos=lower_bound(v.begin(),v.end(),make_pair(xx,0))-v.begin();
        if(pos==i) pos++;
        if(pos<v.size()&&v[pos].first>=xx&&v[pos].first<=yy)
        {
         //   cout<<v[pos].first<<endl;
            flag=true;
            break;
        }
    }
    if(v.size()==0&&A==B) flag=true;
    if(flag)
        printf("Yes\n");
    else printf("No\n");
}
/*
6
)))((((
))))(((
))))((
))((((
))
((


))))((((
))
((
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: 'l' was not declared in this scope
   24 |     if(B+b!=A+l)
      |               ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){
  string data;
  int a=0,b=0,c,d=0;
  cin>>c;
  while(getline(cin,data)){
    if(data.size>=2){
      if(data.front()=='(' and data.back()==')')d+=1;
      else if(data.front()=='(')a+=1;
      else if(data.back()==')')b+=1;
    }
    else{
      if(data[0]='(')a+=1;
      else if(data[0]==')')b+=1;
    }
    
  }
  if((a>=1 and b>=1) or (a>=1 and d>=1) or (b>=1 and d>=1) or(d>=2) ){
    cout<<"Yes";
  }
  else{
    cout<<"No";
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   10 |     if(data.size>=2){
      |        ~~~~~^~~~
      |                 ()
Language: C++

#include <bits/stdc++.h>
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimization ("O2")
#pragma GCC target("popcnt")
#pragma GCC target ("avx2")
using namespace std;
vector<pair<int,int>> segment;
vector<int> ssum[2000001];
int n,t;

void update(int pos , int val , int idx){
	pos += t;
	segment[pos] = {val,idx};
	pos /= 2;
	while(pos){
		segment[pos] = segment[2*pos+1];
		if(segment[2*pos].first > segment[2*pos+1].first){
			segment[pos] = segment[2*pos];
		}
		pos /= 2;
	}
}

pair<int,int> getmax(int a , int b , int curr , int l , int r){
	if(b < l || a > r){
		return {-10000000,-1};
	}
	if(a <= l && b >= r){
		return segment[curr];
	}
	int mid = (l+r)/2;
	pair<int,int> ret1 = getmax(a,b,2*curr,l,mid) , ret2 = getmax(a,b,2*curr+1,mid+1,r);
	if(ret1.first > ret2.first){
		return ret1;
	}
	return ret2;
}

int main(){
	ios_base::Sync_with_stdio(false);
	cout.tie(NULL);
	cin.tie(NULL);
	cin >> n;
	t = pow(2,ceil(log2(2000000)));
	segment.assign(2*t,{-10000000,-1});
	vector<pair<int,int>> v;
	for(int i = 0 ; i < n ; i += 1){
		string s;
		cin >> s;
		int mini = 0 , sum = 0;
		for(char j : s){
			if(j == '('){
				sum += 1;
			}else{
				sum -= 1;
			}
			mini = min(mini,sum);
		}
		ssum[mini+1000000].push_back(sum);
	}
	for(int i = 0 ; i <= 2000000 ; i += 1){
		sort(ssum[i].begin(),ssum[i].end());
		if(ssum[i].size()){
			update(i,ssum[i].back(),i);
		}
	}
	int sum = 0;
	for(int i = 0 ; i < n ; i += 1){
		pair<int,int> idx = getmax(1000000-sum+1,t,1,1,t);
		// cout << sum << " " << idx.first << " " << idx.second << endl;
		if(idx.second == -1){
			cout << "No" << endl;
			return 0;
		}
		sum += ssum[idx.second].back();
		ssum[idx.second].pop_back();
		if(ssum[idx.second].size() > 0){
			update(idx.second,ssum[idx.second].back(),idx.second);
		}else{
			update(idx.second,-10000000,-1);
		}
	}
	if(sum != 0){
		cout << "No" << endl;
		return 0;
	}
	cout << "Yes" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:19: error: 'Sync_with_stdio' is not a member of 'std::ios_base'
   40 |         ios_base::Sync_with_stdio(false);
      |                   ^~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h> 
using namespace std; 
typedef long long int ll;
bool areParanthesisBalanced(string expr) 
{ 
	stack<char> s;
	for (auto i:expr) 
	{ 
		if (i=='(') 
		{ 
			s.push(i); 
			continue; 
		} 
		if (s.empty()) 
		return false; 

		switch (i) 
		{ 
		case ')': 
			x = s.top(); 
			s.pop(); 
			break; 
		} 
	} 
	return (s.empty()); 
} 

int main()
{
	ll t;
	cin>>t;string a,s="";
	while(t--)
	{
	    cin>>a;
	    s=s+a;
	}
	if(areParanthesisBalanced(s))
		cout<<"Yes\n";
	else
		cout<<"No\n";
}

Compiler output:
a.cc: In function 'bool areParanthesisBalanced(std::string)':
a.cc:20:25: error: 'x' was not declared in this scope
   20 |                         x = s.top();
      |                         ^
Language: C++

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
	ios_base :: sync_with_stdio(false);
	int n = 0;
	cin >> n;
	int ab = 0;
	vector < pair < int, int > > a;
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		int mn = 0;
		int cb = 0;
		for (int j = 0; j < s.size(); j++) {
			if (s[j] == ')') {
				cb--;
			} else {
				cb++;
			}
			mn = min(mn, cb);
		}
		ab += cb;
		a.push_back(make_pair(-mn, -cb));
	}
	if (ab != 0) {
		cout << "No";
		return 0;
	}
	sort(a.begin(), a.end());
	int cs = 0;
	for (int i = 0; i < n; i++) {
		if (cs < a[i].first) {
			cout << "No";
			return 0;
		}
		cs -= a[i].second;
	}
	cout << "Yes";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   33 |         sort(a.begin(), a.end());
      |         ^~~~
      |         short
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U> using Pa = pair<T, U>;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

template<typename Monoid,typename F>
class SegmentTree{
private:
    int sz;
    vector<Monoid> seg;
    const F op;
    const Monoid e;
public:
    SegmentTree(int n,const F op,const Monoid &e):op(op),e(e){
        sz = 1;
        while(sz<=n) sz <<= 1;
        seg.assign(2*sz,e);
    }
    void set(int k, const Monoid &x){
        seg[k+sz] = x;
    }
    void build(){
        for(int i=sz-1;i>0;i--){
            seg[i] = op(seg[2*i],seg[2*i+1]);
        }
    }
    void update(int k,const Monoid &x){
        k += sz;
        seg[k] = x;
        while(k>>=1){
            seg[k] = op(seg[2*k],seg[2*k+1]);
        }
    }
    Monoid query(int l,int r){
        Monoid L = e,R = e;
        for(l+=sz,r+=sz;l<r;l>>=1,r>>=1){
            if(l&1) L = op(L,seg[l++]);
            if(r&1) R = op(seg[--r],R);
        }
        return op(L,R);
    }
    Monoid operator[](const int &k)const{
        return seg[k+sz];
    }
};

using P = Pa<int,int>;

auto op = [&](P a,P b){
    if(a.first!=b.first) return max(a,b);
    else return (P){a.first,max(a.second,b.second)};
};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    int sum = 0;
    int M = 1e6;
    int inf = 1e9;
    vec<priority_queue<int>> list(M+1);
    SegmentTree<P,decltype(op)> seg(M+1,op,{-inf,-1});
    for(int i=0;i<N;i++){
        string S;
        cin >> S;
        int d = 0;
        int mi = 1e9;
        for(auto& c:S){
            d += (c=='('? 1:-1);
            mi = min(mi,d);
        }
        sum += d;
        if(mi>=0) list[0].push(d);
        else list[-mi].push(d);
    }
    if(sum){
        cout << "No\n";
        return 0;
    }
    int now = 0;
    int c = 0;
    for(int i=0;i<=M;i++) if(!list[i].empty()){
        seg.update(i,{list[i].top(),i});
        list[i].pop();
    }
    for(int i=0;i<N;i++){
        auto [val,id] = seg.query(0,now+1);
        if(val==-inf){
            cout << "No\n";
            return 0;
        }
        now += val;
        if(!list[id].empty()){
            seg.update(id,{list[id].top(),id});
        }else seg.update(id,{-inf,1});
    }
    cout << "Yes\n";
}

Compiler output:
a.cc:51:12: error: non-local lambda expression cannot have a capture-default
   51 | auto op = [&](P a,P b){
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)
#define repa(i,n) for (auto& i: n)

template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; }
ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; }
template<class H, class... T> void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 5e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//

struct kk{
    ll p, m;
    kk() { p = 0, m = 0; }
    kk(ll pp, ll mm):p(pp), m(mm){}
};
int main() {
    init();
    ll N;
    cin >> N;
    vc<string> S(N);
    vc<kk> A(N);
    rep(i, N) cin >> S[i];

    ll sum = 0;
    rep(i,N){
        ll a = 0;
        repa(c,S[i]){
            if(c=='('){
                a++;
                A[i].p++;
            }
            else{
                a--;
                if(A[i].p==0)
                    A[i].m++;
                else
                    A[i].p--;
            }
        }
        err(A[i].p, A[i].m);
        sum += a;
    }

    if(sum!=0){
        cout << "No" << endl;
        return 0;
    }

    ll l = 0, r = 0, c = 0;
    bool m0 = false, p0 = false, allb = true;
    rep(i,N){
        ll s = A[i].p - A[i].m;
        if(s>0){
            allb = false;
            if (A[i].m == 0) m0 = true;
            l += s;
        }
        else if(s<0){
            allb = false;
            s = -s;
            if (A[i].p == 0) p0 = true;
            r += s;
        }
        else{
            chmax(c, A[i].p);
        }
    }
    if (c > 0) allb = false;
    // err(m0, p0, l, r, c);

    if(m0 and p0 and l>=c and r>=c)
        cout << "Yes" << endl;
    else if(m0 and p0 and c==0)
        cout << "Yes" << endl;
    else if(allb)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:9: error: 'err' was not declared in this scope; did you mean 'erf'?
   63 |         err(A[i].p, A[i].m);
      |         ^~~
      |         erf
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){
  string data;
  int a=0,b=0,c;
  cin>>c;
  for(int i=0;i<c;i++){
    cin>>data;
    if(data.front()=='(')a+=1;
    if(data.back()==')')b+=1;
    if(a>0 and b>0){
      cout<<"Yes"<<endl;
      break;
    }
  }
  if(!(a>0 and b>0)){
      cout<<"No"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>

using namespace std;
using ll = long long int;

template <typename T>
struct SegmentTree {
    using F = function<T(T, T)>;

    const T e;
    const F f;
    size_t sz;
    vector<T> tree;

    SegmentTree(size_t n, const F &f, const T &e = 0) : f(f), e(e) {
        sz = 1;
        while(sz < n) sz <<= 1;
        tree.assign(2*sz, e);
    }

    void set(typename vector<T>::iterator begin, typename vector<T>::iterator end) {
        copy(begin, end, tree.begin() + sz);
        for(size_t k=sz-1; k>0; k--)
            tree[k] = f(tree[2*k+0], tree[2*k+1]);
    }

    void update(size_t k, const T &x) {
        k += sz;
        tree[k] = x;
        while(k >>= 1)
            tree[k] = f(tree[2*k+0], tree[2*k+1]);
    }

    T query(size_t a, size_t b) const {
        b = min(b, sz);
        a = max((size_t)0, a);
        T l = e, r = e;
        for(a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
            if(a & 1) l = f(l, tree[a++]);
            if(b & 1) r = f(tree[--b], r);
        }
        return f(l, r);
    }

    T operator[](const size_t k) const {
        return tree[sz + k];
    }
};

/*
   SegmentTree<long> st(n, [&](long a, long b){return min(a, b);}, 1e9);
   st.set(a.begin(), a.end());

   [&](F a, F b) -> F { return {b.first * a.first % MOD, (b.first * a.second + b.second) % MOD};
   */

int main(void) {
    ll n;
    cin >> n;

    priority_queue<ll> q;

    ll rem = n, ma = 0;

    map<ll, vector<ll>> u;
    for(ll i=0; i<n; i++) {
        string s;
        cin >> s;
        ll t = 0, r = 0;
        for(auto &c: s) {
            if(c == '(')
                t++;
            else
                t--, r = max(r, -t);
        }
        u[r].push_back(t);
    }
    for(auto &[t, v]: u)
        sort(v.begin(), v.end());

    ll s = 0;
    for(auto &e: u[0]);
    q.push(e);
    while(!q.empty()) {
        rem--;
        auto t = q.top(); q.pop();
        s += t;
        while(ma < s)
            for(auto &e: u[++ma])
                q.push(e);
    }

    bool ok = rem == 0;
    cout << (ok && (s == 0) ? "Yes" : "No") << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:83:12: error: 'e' was not declared in this scope
   83 |     q.push(e);
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <cstring>
#include <climits>
using namespace std;

#define rep(i,a,b) for(int i = a;i<b;i++)

bool compare(pair<int,int> &a,pair<int,int> &b)
{
	return a.second >= b.first;
}

int main()
{
	int n;
	cin >> n;
	vector<string> s;
	s.resize(n);
	pair<int,int> arr[n];
	rep(j,0,n)
	{
		cin >> s[j];
		string k = s[j];
		int cl = 0, op = 0;
		rep(i,0,k.size())
		{
			if(k[i] == '(') op++;
			else if(k[i] == ')')
			{
				op--;
				if(op < 0)
				{
					cl += -op;
					op = 0;
				}
			}
		}
		arr[j].first = cl;
		arr[j].second = op;
	}

	sort(arr, arr+n, compare);
	if(arr[0].first != 0 && arr[n-1].second != 0)
	{
		cout << "No" << endl;
		return 0;
	}
	int finalAns = 0;
	rep(i,0,n-1)
	{
		finalAns += arr[i].second - arr[i+1].first;
		if(finalAns < 0) break;
	}
	if(finalAns == 0) cout << "Yes" << endl;
	else cout << "No" << endl; 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   43 |         sort(arr, arr+n, compare);
      |         ^~~~
      |         short
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
    int N;
    cin >> N;
    vector<string> S(N);
    for (int i = 0; i < N; i++) cin >> S[i];
    
    vector<pair<int, int>> ps1, ps2;
    
    int all = 0;
    for (int i = 0; i < N; i++) {
        int K = S[i].size();
        int bottom = 0;
        int sub = 0;
        int now = 0;
        for (int j = 0; j < K; j++) {
            if (S[i][j] == '(') {
                now++;
                sub++;
            }else {
                now--;
                sub--;
            }
            bottom = min(bottom, now);
        }
        all += sub;
        if (sub > 0) ps1.push_back({sub, bottom});
        else ps2.push_back({sub, bottom});
    }
    
    sort(ps1.begin(), ps1.end(), [](auto x, auto y){if (x.second != y.second) return x.second > y.second; else return x.first > y.first});
    sort(ps2.begin(), ps2.end(), [](auto x, auto y){return x.first + y.second > x.first + y.second;});
    
    if (all != 0) {
        cout << "No\n";
        return 0;
    }
    
    int pos = 0;
    for (int i = 0; i < (int)ps1.size(); i++) {
        if (pos + ps1[i].second < 0) {
            cout << "No\n";
            return 0;
        }
        pos += ps1[i].first;
    }
    for (int i = 0; i < (int)ps2.size(); i++) {
        if (pos + ps2[i].second < 0) {
            cout << "No\n";
            return 0;
        }
        pos += ps2[i].first;
    }
    cout << "Yes\n";
    return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:34:136: error: expected ';' before '}' token
   34 |     sort(ps1.begin(), ps1.end(), [](auto x, auto y){if (x.second != y.second) return x.second > y.second; else return x.first > y.first});
      |                                                                                                                                        ^
      |                                                                                                                                        ;
Language: C++

// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(long long i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];cout<<endl;}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int> tp;
typedef vector<tp> vt;
typedef vector<vt>vvt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

//nCr mod m
#define MOD 998244353
#define M 500000
vector<ll> fact;
bool h=false;
void init(){
	h=true;
	fact=vector<ll>(M);
	fact[0]=fact[1]=1;
	loop(i,2,M)fact[i]=fact[i-1]*i%MOD;
}
// a^b mod MOD
ll powmod(ll a,ll b,ll m=MOD){
	ll out=1;
	ll p=a%m;
	while(b){
		if(b&1)out=out*p%m;
		p=p*p%m;
		b>>=1;
	}
	return out;
}
//nCr
ll nCr(ll n,ll r,ll m=MOD){
	if(!h)init();
	if(n<0||r<0||n<r)return 1;//??????
	ll out=fact[n]*powmod(fact[r]*fact[n-r]%m,m-2,m)%m;
	return out;
}
int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
vi dp(1000,-1);
int f(int a){
	if(dp[a]+1)return dp[a];
	return dp[a]=powmod(fact[a],MOD-2,MOD);
}
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

	int n;
	cin>>n;
	vs in(n);
	rep(i,n)cin>>in[i];
	vvi a,b;
	int c=0;
	rep(i,n){
		int s=0,mi=0;
		rep(j,in[i].size()){
			if(in[i][j]=='(')s++;
			else s--;
			cmin(mi,s);
		}
		if(s>0){
			a.pb({mi,s-mi});
		}else b.pb({s-mi,mi});
!		c+=s;
	}
	if(c){
		no;
		return 0;
	}
	int s=0;
	sort(all(a));
	rep(i,a.size()){
		if(s+a[i][0]<0){
			no;
			return 0;
		}
		s+=a[i][1];
	}
	sort(all(b));
	rep(i,b.size()){
		if(s+b[b.size()-1-i][1]<0){
			no;
			return 0;
		}
		s+=b[b.size()-1-i][0];
	}

	yes;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:119:1: error: lvalue required as left operand of assignment
  119 | !               c+=s;
      | ^~~~~~~~~~~~~~~~~
Language: C

#include<bits/stdc++.h>
using namespace std;
const int N=200;
int main()
{
	int n=0,t=0;
	scanf("%d",&n);
	while(n--)
	{
		int s[N]={0};
		scanf("%s",s);
		for(int i=0;s[i];i++)
		{
			if(s[i]=='(')
				t--;
			else if(s[i]==')')
				t++;
		}
	}
	if(t==0)
		printf("Yes");
	else
		printf("No");
    return 0;
} 

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){
  string N;
  cin >> N;
  if(N = "ABC"){
    cout << "ARC";
  }
  else{
    cout << "ABC";
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: could not convert 'N.std::__cxx11::basic_string<char>::operator=(((const char*)"ABC"))' from 'std::__cxx11::basic_string<char>' to 'bool'
    8 |   if(N = "ABC"){
      |      ~~^~~~~~~
      |        |
      |        std::__cxx11::basic_string<char>
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main() string s; cin >> s; if(s=="ARC") cout << "ABC"; else cout << "ARC" <<endl; return 0;

Compiler output:
a.cc:4:12: error: expected initializer before 'string'
    4 | int main() string s; cin >> s; if(s=="ARC") cout << "ABC"; else cout << "ARC" <<endl; return 0;
      |            ^~~~~~
a.cc:4:22: error: 'cin' does not name a type
    4 | int main() string s; cin >> s; if(s=="ARC") cout << "ABC"; else cout << "ARC" <<endl; return 0;
      |                      ^~~
a.cc:4:32: error: expected unqualified-id before 'if'
    4 | int main() string s; cin >> s; if(s=="ARC") cout << "ABC"; else cout << "ARC" <<endl; return 0;
      |                                ^~
a.cc:4:60: error: expected unqualified-id before 'else'
    4 | int main() string s; cin >> s; if(s=="ARC") cout << "ABC"; else cout << "ARC" <<endl; return 0;
      |                                                            ^~~~
a.cc:4:87: error: expected unqualified-id before 'return'
    4 | int main() string s; cin >> s; if(s=="ARC") cout << "ABC"; else cout << "ARC" <<endl; return 0;
      |                                                                                       ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
  string x;
  cin >> x;
  if(x==ABC) {
    cout << "ARC" << endl;
  } else {
    cout << "ABC" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'ABC' was not declared in this scope
    7 |   if(x==ABC) {
      |         ^~~
Language: C

#include <stdio.h>
#include <string.h>
int main(void)
{
	char S[3],B[] = ABC,R[] = ARC;
	scanf("%s",S);
	if(strcmp(S,B) == 0){
		printf("ARC");
	}else if(strcmp(S,R) == 0){
		printf("ABC");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:25: error: 'ABC' undeclared (first use in this function)
    5 |         char S[3],B[] = ABC,R[] = ARC;
      |                         ^~~
main.c:5:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:35: error: 'ARC' undeclared (first use in this function)
    5 |         char S[3],B[] = ABC,R[] = ARC;
      |                                   ^~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  string (s=="ABC"|| s=="ARC");
  cin>>s;
  cout<<s;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: 's' was not declared in this scope
    5 |   string (s=="ABC"|| s=="ARC");
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  string (s="ABC"|| s=="ARC");
  cin>>s;
  cout<<s;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: 's' was not declared in this scope
    5 |   string (s="ABC"|| s=="ARC");
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  string S;
  (S=="ABC"||S=="ARC")
  cin>>S;
  cout<<S;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: expected ';' before 'cin'
    6 |   (S=="ABC"||S=="ARC")
      |                       ^
      |                       ;
    7 |   cin>>S;
      |   ~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  string s;
  (s=="ABC"||s=="ARC")
  cin>>s;
  cout<<s;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: expected ';' before 'cin'
    6 |   (s=="ABC"||s=="ARC")
      |                       ^
      |                       ;
    7 |   cin>>s;
      |   ~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  string s;
  (s==ABC||s==ARC)
  cin>>s;
  cout<<s;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'ABC' was not declared in this scope
    6 |   (s==ABC||s==ARC)
      |       ^~~
a.cc:6:15: error: 'ARC' was not declared in this scope
    6 |   (s==ABC||s==ARC)
      |               ^~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  string s;
  (s==ABC||S==ARC)
  cin>>s;
  cout<<s;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'ABC' was not declared in this scope
    6 |   (s==ABC||S==ARC)
      |       ^~~
a.cc:6:12: error: 'S' was not declared in this scope
    6 |   (s==ABC||S==ARC)
      |            ^
a.cc:6:15: error: 'ARC' was not declared in this scope
    6 |   (s==ABC||S==ARC)
      |               ^~~
Language: C++


#include <iostream>
#include <string>
#include <map> //map<string, int> cnt; key とvalue
#include <set>//  set<int> s;
#include <cstdlib>  // abs() for integer
#include <vector>
#define rep(i,n) for(int i = 0 ; i < (n); ++i)
using namespace std;
using ll = long long;
// g++ -std=c++11
int main(){
  string s;
  cin >> s;
  if(s == "ABC") cout << "ARC" << endl; return 0;
  // if(s == "ARC") cout << "ABC" << endl; return 0;
  else cout << "ABC" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'else' without a previous 'if'
   17 |   else cout << "ABC" << endl;
      |   ^~~~
Language: C++

a = input()
if a == "ABC:
	print("ARC)
else:
	print("ABC")


Compiler output:
a.cc:2:9: warning: missing terminating " character
    2 | if a == "ABC:
      |         ^
a.cc:2:9: error: missing terminating " character
    2 | if a == "ABC:
      |         ^~~~~
a.cc:3:15: warning: missing terminating " character
    3 |         print("ARC)
      |               ^
a.cc:3:15: error: missing terminating " character
    3 |         print("ARC)
      |               ^~~~~
a.cc:1:1: error: 'a' does not name a type
    1 | a = input()
      | ^
Language: C++

#include<stdio.h>
int main(void)
(
    char s[4];
	scanf("%s\",s);
	if(s[1]=='B') {
		s[1] = 'R';
		printf("%s\n",s);
	}
	else {
		s[1]=='R';
		printf("%s\n",s);
	}
	return 0
)	

Compiler output:
a.cc:5:15: warning: missing terminating " character
    5 |         scanf("%s\",s);
      |               ^
a.cc:5:15: error: missing terminating " character
    5 |         scanf("%s\",s);
      |               ^~~~~~~~~
a.cc:4:14: error: expected ')' before ';' token
    4 |     char s[4];
      |              ^
      |              )
a.cc:3:1: note: to match this '('
    3 | (
      | ^
a.cc:2:1: error: 'main' declared as function returning a function
    2 | int main(void)
      | ^~~
a.cc:5:14: error: expected constructor, destructor, or type conversion before '(' token
    5 |         scanf("%s\",s);
      |              ^
a.cc:10:9: error: expected unqualified-id before 'else'
   10 |         else {
      |         ^~~~
a.cc:14:9: error: expected unqualified-id before 'return'
   14 |         return 0
      |         ^~~~~~
Language: C++

#include<stdio.h>
int main(void)
(
    char s[4];
	scanf("%s\",s);
	if(s[1]=='B') {
		s[1] = 'R';
		printf("%s\n",s);
	}
	else {
		s[1]=='R'
		printf("%s\n",s);
	}
	return 0
	)

Compiler output:
a.cc:5:15: warning: missing terminating " character
    5 |         scanf("%s\",s);
      |               ^
a.cc:5:15: error: missing terminating " character
    5 |         scanf("%s\",s);
      |               ^~~~~~~~~
a.cc:4:14: error: expected ')' before ';' token
    4 |     char s[4];
      |              ^
      |              )
a.cc:3:1: note: to match this '('
    3 | (
      | ^
a.cc:2:1: error: 'main' declared as function returning a function
    2 | int main(void)
      | ^~~
a.cc:5:14: error: expected constructor, destructor, or type conversion before '(' token
    5 |         scanf("%s\",s);
      |              ^
a.cc:10:9: error: expected unqualified-id before 'else'
   10 |         else {
      |         ^~~~
a.cc:14:9: error: expected unqualified-id before 'return'
   14 |         return 0
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define init(a,i) for(int k=0;k<(i);k++)(a)[k]=0
#define in(a,i) for(int k=0;k<(i);k++)cin>>(a)[k]
#define all(a)  (a).begin(),(a).end()
#define mod 1000000007
#define inf 2147483647
#define range(x,a,b) (a)<=x&&x<=(b)
int main(){
	string s;
	cin>>s;
	if(s[1]=='B')a[1]='R';
	else a[1]='B';
	cout<<s;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: 'a' was not declared in this scope
   15 |         if(s[1]=='B')a[1]='R';
      |                      ^
a.cc:16:14: error: 'a' was not declared in this scope
   16 |         else a[1]='B';
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define init(a,i) for(int k=0;k<(i);k++)(a)[k]=0
#define in(a,i) for(int k=0;k<(i);k++)cin>>(a)[k]
#define all(a)  (a).begin(),(a).end()
#define mod 1000000007
#define inf 2147483647
#define range(x,a,b) (a)<=x&&x<=(b)
int main(){
	string s;
	cin>>s;
	if(s[1]=='B')a[1]='R'
	else a[1]='B';
	cout<<s;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: 'a' was not declared in this scope
   15 |         if(s[1]=='B')a[1]='R'
      |                      ^
Language: C

#include<stdio.h>
int main(void){
  char S[3];
  scanf("%s",&S);
  if(S==ABC)
    printf("ARC");
  if(S==ARC)
    printf("ABC");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: 'ABC' undeclared (first use in this function)
    5 |   if(S==ABC)
      |         ^~~
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:9: error: 'ARC' undeclared (first use in this function)
    7 |   if(S==ARC)
      |         ^~~
Language: C++

#include <bits/c++.h>
using namespace std;

int main(){
	string s;
  	cin >> s;
  	if(s == "ABC") cout << "ARC" <<endl;
  	else cout << "ABC" << endl;
}

Compiler output:
a.cc:1:10: fatal error: bits/c++.h: No such file or directory
    1 | #include <bits/c++.h>
      |          ^~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>

int main(){
  std::string input;
  std::cin >> input;
  
  switch(input){
    case "ABC":
      std::cout << "ARC";
      break;
    case "ARC":
      std::cout << "ABC";
      break;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: switch quantity not an integer
    8 |   switch(input){
      |          ^~~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
    string a;
    cin >> a;
    
    if(a==ABC) {
    cout << "ARC" << endl;
    }
    
    else cout << "ABC" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 'ABC' was not declared in this scope
    7 |     if(a==ABC) {
      |           ^~~
Language: C++

# include <iostream>

using namespace std;

int main()
{
  string S;
  cin >> S;
  
  if(string == "ABC")
    cout << "ARC";
  else
    cout << "ABC";
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: expected unqualified-id before '==' token
   10 |   if(string == "ABC")
      |             ^~
Language: C

#include <stdio.h>
#include <string.h>
int main(){
  char s[3];
  gets(s);
  if(strcmp(s, 'ABC') == 0)
    printf("ARC");
  else
    printf("ABC");
return 0;

Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    5 |   gets(s);
      |   ^~~~
      |   fgets
main.c:6:16: warning: multi-character character constant [-Wmultichar]
    6 |   if(strcmp(s, 'ABC') == 0)
      |                ^~~~~
main.c:6:16: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
    6 |   if(strcmp(s, 'ABC') == 0)
      |                ^~~~~
      |                |
      |                int
In file included from main.c:2:
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
main.c:10:1: error: expected declaration or statement at end of input
   10 | return 0;
      | ^~~~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;

public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        
        String S = br.readLine();
        
        if(S.equals("ABC"))) {
            pw.println("ARC");
        } else {
            pw.println("ABC");
        }

        br.close();
        pw.close();
    }
}

Compiler output:
Main.java:13: error: illegal start of expression
        if(S.equals("ABC"))) {
                           ^
Main.java:15: error: 'else' without 'if'
        } else {
          ^
2 errors
Language: C++

#include <stdio.h>

int main(){
	char contest[450];
	scanf("%s",contest);
	if (contest[1]="B"){
		printf("ARC\n");
	}
	else if (contest [1]="R"){
		printf("ABC\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
    6 |         if (contest[1]="B"){
      |                        ^~~
      |                        |
      |                        const char*
a.cc:9:30: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
    9 |         else if (contest [1]="R"){
      |                              ^~~
      |                              |
      |                              const char*