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

#include<iostream>
using namespace std;


int main(){
  int a,b,c,d,e,na,nb,nc;
  while(cin>>a>>b>>c>>d>>e,a!=0){
    cin>>na>>nb>>nc;
    int ans = 0;
    int tmp_ans = 0;
    for(int i=0;i<nc+nb+na;i++){
      int tmp;
      if(i<nc)tmp=c;
      else if(i<nc+nb)tmp=b;
      else if(i<nc+nb+na)tmp=a;
      tmp_ans+=tmp;
      if(i<d-1){
      }else if(i==d-1){
        ans =min(tmp_ans,d*e);
        tmp_ans=0;
      }else if(i<nc){
        tmp_ans=0;
        ans += e;
      }
    }
    if(nc+nb+na < d){
      ans = min(tmp_ans,d*e);
      tmp_ans = 0;
    }
    cout<<ans+tmp_ans<<endl;
  }
}#include<iostream>
using namespace std;


int main(){
  int a,b,c,d,e,na,nb,nc;
  while(cin>>a>>b>>c>>d>>e,a!=0){
    cin>>na>>nb>>nc;
    int ans = 0;
    int tmp_ans = 0;
    for(int i=0;i<nc+nb+na;i++){
      int tmp;
      if(i<nc)tmp=c;
      else if(i<nc+nb)tmp=b;
      else if(i<nc+nb+na)tmp=a;
      tmp_ans+=tmp;
      if(i<d-1){
      }else if(i==d-1){
        ans =min(tmp_ans,d*e);
        tmp_ans=0;
      }else if(i<nc){
        tmp_ans=0;
        ans += e;
      }
    }
    if(nc+nb+na < d){
      ans = min(tmp_ans,d*e);
      tmp_ans = 0;
    }
    cout<<ans+tmp_ans<<endl;
  }
}

Compiler output:
a.cc:32:2: error: stray '#' in program
   32 | }#include<iostream>
      |  ^
a.cc:32:3: error: 'include' does not name a type
   32 | }#include<iostream>
      |   ^~~~~~~
a.cc:36:5: error: redefinition of 'int main()'
   36 | int main(){
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main(){
      |     ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(x,b) (0<=(x)&&(x)<(b))
using namespace std;
int box[5][5][5];
int M[2][27];

int judge(int z, int y, int x){
  int a = 0;
  for(int i = -1; i <= 1; ++i)
    for(int j = -1; j <= 1; ++j)
      for(int k = -1; k <= 1; ++k)
	if(BW(z+i,5) && BW(y+j,5) && BW(x+k,5))
	  a += box[z+i][y+j][x+k];
	
  a -= box[z][y][x];
  if(M[box[z][y][x]][a]) return 1;
  return 0;
}

int main(){
  int N, cnt = 1, a, b;
  char in[8];
  while(scanf("%d", &N) && N){
    rep(i, 5) rep(j, 5){
      scanf("%s", in);
      rep(k, 5) box[i][j][k] = in[k]-'0';
    }
    rep(i, 2){
      rep(j, 27) M[i][j] = 0;
      scanf("%d", &a);
      while(a--){
	scanf("%d", &b);
	M[i][b] = 1;
      }
    }
    rep(j, 27) M[1][j] ^= 1;

    rep(h, N){
      queue<int>zq,xq,yq;
      rep(i, 5) rep(j,5) rep(k, 5){
	if(judge(i, j, k)){
	  zq.push(i); yq.push(j); xq.push(k);
	}
      }

      while(!zq.empty()){
	int z, x, y;
	z = zq.front(); zq.pop();
	y = yq.front(); yq.pop();
	x = xq.front(); xq.pop();
	box[z][y][x] ^= 1;
      }
    }
    if(cnt>1) puts("");
    printf("Case %d:\n", cnt);
    rep(i, 5){
      rep(j, 5){
	rep(k, 5) printf("%d", box[i][j][k]);
	puts("");
      }
    }
    cnt++;
  }
  retu

Compiler output:
a.cc: In function 'int main()':
a.cc:77:3: error: 'retu' was not declared in this scope
   77 |   retu
      |   ^~~~
a.cc:77:7: error: expected '}' at end of input
   77 |   retu
      |       ^
a.cc:33:11: note: to match this '{'
   33 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int score[6];

int ans = 0;

void fallBlock(int mas[5][5])
{
  for(int i = 4; i > 0; i--){
    for(int j = 0; j < 5; j++){
      if(mas[i][j] == 0){
	swap(mas[i-1][j], mas[i][j]);
      }
    }
  }

  return;
}
void fallBlock(int mas[5][5])
{
  for(int i = 4; i > 0; i--){
    for(int j = 0; j < 5; j++){
      if(mas[i][j] == 0){
	swap(mas[i-1][j], mas[i][j]);
      }
    }
  }

  return;
}

int getPoint(int mas[5][5])
{
  int point = 0;
  
  for(int i = 0; i < 3; i++){
    for(int j = 0; j < 5; j++){
      if(abs(mas[i][j]) == abs(mas[i+1][j]) &&
	 abs(mas[i][j]) == abs(mas[i+2][j])){
	mas[i][j] = mas[i+1][j] = mas[i+2][j] = -abs(mas[i][j]);
      }
    }
  }
  for(int i = 0; i < 5; i++){
    for(int j = 0; j < 3; j++){
      if(abs(mas[i][j]) == abs(mas[i][j+1]) &&
	 abs(mas[i][j]) == abs(mas[i][j+2])){
	mas[i][j] = mas[i][j+1] = mas[i][j+2] = -abs(mas[i][j]);
      }
    }
  }
  
  for(int i = 0; i < 5; i++){
    for(int j = 0; j < 5; j++){
      point += (mas[i][j] < 0) * score[-mas[i][j]];
      mas[i][j] = 0;
    }
  }

  fallBlock(mas);

  return point;
}

void dfs(int y, int x, int n, int mas[5][5])
{
  static int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
  int p = 0;
  
  if(n > 0){
    for(int i = 0; i < 4; i++){
      int nx = x + dx[i], ny = y + dy[i];
      if(n > 0 && 0 <= nx && nx < 5 && 0 <= ny && ny < 5){
	int tmp[5][5];
	for(int k = 0; k < 5; k++){
	  for(int l = 0; l < 5; l++) tmp[k][l] = mas[k][l];
	}
	swap(tmp[y][x], tmp[ny][nx]);
	dfs(ny, nx, n-1, tmp);
      }
    }
  }
  
  for(int bonus = 1, get = getPoint(mas); get > 0; bonus++, get = getPoint(mas))
    p += get * bonus;
  ans = max(ans, p);

  return;
}

int main()
{
  int n;
  int mas[5][5];
  
  while(cin >> n, n != -1){
    ans = 0;
    for(int i = 0; i < 5; i++){
      for(int j = 0; j < 5; j++) cin >> mas[i][j];
    }
    for(int i = 1; i <= 5; i++) cin >> score[i];
    
    for(int i = 0; i < 5; i++){
      for(int j = 0; j < 5; j++){
	int tmp[5][5];
	for(int k = 0; k < 5; k++){
	  for(int l = 0; l < 5; l++) tmp[k][l] = mas[k][l];
	}
	dfs(i, j, n, tmp);
      }
    }
    
    cout << ans << endl;
  }

  return 0;
}

Compiler output:
a.cc:21:6: error: redefinition of 'void fallBlock(int (*)[5])'
   21 | void fallBlock(int mas[5][5])
      |      ^~~~~~~~~
a.cc:9:6: note: 'void fallBlock(int (*)[5])' previously defined here
    9 | void fallBlock(int mas[5][5])
      |      ^~~~~~~~~
Language: Java

import java.util.Scanner;
 
class Main{

	public static final String [][] PANEL = { { "A" , "B" , "C" } ,
						  { "D" , "E" , "F" } ,
						  { "G" , "H" , "I" } };
	public static void main(String[] args){
    		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		for ( int cnt = 0;cnt < 1000;cnt++ ){
			if( panelSearch(str) ){
				System.out.println(str);
			}
		}
		
    	}

	public boolean panelSearch(String str){
		int tmp;
		int num;
		for( int cnt = 0;cnt < str.length();cnt++){
			num = seach(str.charAt(cnt));
			if( cnt = 0 ){
				tmp = num;
				continue;
			}
			if( Math.abs(tmp - num) != 1 OR num == -1 ){
				return false;
			}
		}
		return true;
	}

	public int seach(String str){
		
		for( int xCnt = 0;xCnt < 3;xCnt++ ){
			for( int yCnt = 0;yCnt < 3;yCnt++ ){
				if( PANEL[xCnt][yCnt].equals(str) ){
					return xCnt + yCnt;
				}
			}
		}
		return -1;
	}
}

Compiler output:
Main.java:28: error: ')' expected
			if( Math.abs(tmp - num) != 1 OR num == -1 ){
			                            ^
Main.java:28: error: ';' expected
			if( Math.abs(tmp - num) != 1 OR num == -1 ){
			                                   ^
Main.java:28: error: variable declaration not allowed here
			if( Math.abs(tmp - num) != 1 OR num == -1 ){
			                                ^
3 errors
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
 
using namespace std;
 
#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
 
const int INF = 10000000;

int dx[]={-1,0,1,0};
int dy[]={0,-1,0,1};
char c[3][3];
string s;
bool f;

void calc(int x, int y, int n){
	if(n == s.size() || f) {
		f = true;
		return true;
	}
	for(int i = 0; i < 4; i++){
		int nx = x + dx[i], ny = y + dy[i];
		if(nx >= 0 && nx < 3 && ny >= 0 && ny < 3){
			if(c[nx][ny] == s[n]){
				calc(nx, ny, n + 1);
			}
		}
	}
}

int main(){
	for(int i = 0; i < 3; i++){
		for(int j = 0; j < 3; j++){
			c[i][j] = 'a' + i * 3 + j;
		}
	}
	while(cin>>s){
		f = false;
		calc(0, 0, 0);
		if(f) cout<<s<<endl;
	}
}

Compiler output:
a.cc: In function 'void calc(int, int, int)':
a.cc:46:24: error: return-statement with a value, in function returning 'void' [-fpermissive]
   46 |                 return true;
      |                        ^~~~
Language: C++

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

bool hitofude(char a,char b){
	if(a=='A'){
		if(b=='B'||b=='D')return true;
		return false;
		}
	if(a=='B'){
		if(b=='A'||b=='E'||b=='C')return true;
		return false;
		}	
	if(a=='C')	{
		if(b=='B'||b=='F')return true;
		return false;
		}
	if(a=='D'){
		if(b=='A'||b=='E'||b=='G')return true;
		return false;
		}	
	if(a=='E'){
		if(b=='B'||b=='D'||b=='H'||b=='F')return true;
		return false;
		}	
	if(a=='F'){
		if(b=='C'||b=='E'||b=='I')return true;
		return false;
		}	
	if(a=='G'){
		if(b=='D'||b=='H')return true;
		return false;
		}	
	if(a=='H'){
		if(b=='E'||b=='G'||b=='I')return true;
		return false;
		}	
	if(a=='I')	{
		if(b=='F'||b=='H')return true;
		return false;
		}
		return true;
	}

int main(){
	for(int i=0;i<1000;i++){
		string s;
		cin>>s;
		int flg=1;
		for(int i=1;i<s.size();i++){
			if(!hiotofude(s[i-1],s[i]))flg=0;
			}
		if(flg)cout<<s<<endl;	
		}
		return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:29: error: 'hiotofude' was not declared in this scope; did you mean 'hitofude'?
   50 |                         if(!hiotofude(s[i-1],s[i]))flg=0;
      |                             ^~~~~~~~~
      |                             hitofude
Language: C++

#include <iostream>
using namespace std;
int n,m,r,c,si,an;
bool a[20][20],b[20][20]; 

void check() {

 cout << endl;
 cout << " --------------------------"<< endl;
for(int i=0;i<n;i++) {
   for(int j=0;j<n;j++) {

     cout <<a[i][j];
     if(j != n-1) cout <<" ";
   }
   cout << endl;
 }
cout << "--------------------------"<< endl;
cout<< endl;

}

void rotate() {

 for(int rt=0;rt<an/90;rt++) {

   for(int i=0;i<si;i++){
     for(int j=0;j<si;j++) {
   b[r+i][c+j] = a[c+si-j-1][r+i];
     }
   }
   for(int i=0;i<si;i++)
     for(int j=0;j<si;j++) 
   a[r+i][c+j] = b[r+i][c+j];

 }

}

void reversal() {

 for(int i=r;i<r+si;i++) {
   for(int j=c;j<c+si;j++) {
     a[i][j] = !a[i][j];
   }
 }

}

void IR(int x, int y) {
 int dx[4] = {0,0,1,-1};
 int dy[4] = {-1,1,0,0};

 a[y][x] = !a[y][x];

 for(int i=0;i<4;i++) {
   if(y+dy[i] >= 0 && y+dy[i] <n && x+dx[i] >=0 && x+dx[i] < n) 
     if(a[y+dy[i]][x+dx[i]] != a[y][x])
   IR(x+dx[i],y+dy[i]);  
 }
}


void RS() {

 a[r][0] = b[r][n-1];
 for(int i=1;i<n;i++) a[r][i] = b[r][i-1];
 for(int i=0;i<n;i++) b[r][i] = a[r][i];


}

void LS() {
 a[r][n-1] = b[r][0];
 for(int i=n-2;i>=0;i--) a[r][i] = b[r][i+1];
 for(int i=0;i<n;i++) b[r][i] = a[r][i];

}

int main(){

 cin >> n >> m;

 for(int i=0;i<n;i++) {
   for(int j=0;j<n;j++){
     cin >> a[i][j];
     b[i][j] = a[i][j];
   }
 }


 int o;

 for(int i=0;i<m;i++) {
 cin >> o;

 if(o == 0){
   cin >> r >> c >> si >> an;
   r--;
   c--;
   rotate();
 }
 else if(o == 1) {
   cin >> r >> c >> si;
   r--;
   c--;
   reversal();
 } 
 else if(o == 2) {
   cin >> r;
   r--;
   LS();
 }
 else if(o==3) {
   cin >> r;
   r--;
   RS();
 }
 else if(o == 4) {
   cin >> r >> c ;
   r--;
   c--;
   IR(c,r);

 }

 }


 for(int i=0;i<n;i++) {
   for(int j=0;j<n;j++) {

     cout <<a[i][j];
     if(j != n-1) cout <<" ";
   }
   cout << endl;
 }

 return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:139:11: error: expected '}' at end of input
  139 |  return 0;
      |           ^
a.cc:80:11: note: to match this '{'
   80 | int main(){
      |           ^
Language: C++

#include <queue>
#include <set>
#include <cstdio>
#include <cstdlib>
using namespace std;
typedef pair<int,int> pii;
int M[15][15],N[15][15];
int D[4][2]={{-1,0},{0,-1},{1,0},{0,1}};
int main(){
	int n,m,x,y,o,r,c,s,a;
	scanf("%d%d",&n,&m);
	for(y=0;y<n;y++)for(x=0;x<n;x++)scanf("%d",M[y]+x);
	for(;m--;){
		scanf("%d",&o);
		if(o==0){
			scanf("%d%d%d%d",&r,&c,&s,&a);r--,c--;
			if(a){
				memcpy(N,M,sizeof(M));
				for(y=0;y<s;y++)for(x=0;x<s;x++){
					if(a==90)N[r+y][c+x]=M[c+s-x-1][r+y];
					else if(a==180)N[r+y][c+x]=M[r+s-y-1][c+s-x-1];
					else if(a==270)N[r+y][c+x]=M[c+x][r+s-y-1];
				}
				memcpy(M,N,sizeof(M));
			}
		}else if(o==1){
			scanf("%d%d%d",&r,&c,&s);r--,c--;
			for(y=r;y<r+s;y++)for(x=c;x<c+s;x++)M[y][x]^=1;
		}else if(o==2){
			scanf("%d",&r);r--;
			y=M[r][0];for(x=0;x<n-1;x++)M[r][x]=M[r][x+1];
			M[r][n-1]=y;
		}else if(o==3){
			scanf("%d",&r);r--;
			y=M[r][n-1];for(x=n-1;x>0;x--)M[r][x]=M[r][x-1];
			M[r][0]=y;
		}else if(o==4){
			scanf("%d%d",&r,&c);r--,c--;
			set<pii>se;
			queue<pii>q;
			q.push(make_pair(r,c));
			for(;!q.empty();){
				pii p=q.front();q.pop();
				for(s=0;s<4;s++){
					y=p.first+D[s][0],x=p.second+D[s][1];
					if(0<=x&&x<n&&0<=y&&y<n&&M[y][x]==M[r][c]){
						pii _p=make_pair(y,x);
						if(se.find(_p)==se.end()){
							se.insert(_p);
							q.push(_p);
						}
					}
				}
			}
			set<pii>::iterator it=se.begin();
			for(;it!=se.end();it++)M[it->first][it->second]^=1;
		}
	}
	for(y=0;y<n;y++)for(x=0;x<n;x++)printf(x<n-1?"%d ":"%d\n",M[y][x]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:33: error: 'memcpy' was not declared in this scope
   18 |                                 memcpy(N,M,sizeof(M));
      |                                 ^~~~~~
a.cc:5:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <cstdlib>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

{
  int tmp[16][16];
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
      tmp[i][j]=data[i][j];


  for(int j=r;j<r+s;j++)
    for(int k=c;k<c+s;k++)
      {
	//		cout<<j<<" "<<k<<"<= ";
	//	cout<<r+s-1-(k-c)<<" "<<c+(j-r)<<endl;
	tmp[j][k]=data[r+s-1-(k-c)][c+(j-r)];
	//	tmp[j][k]=data[c+s-1-(k-c)][r+s-1-(j-r)];
	//tmp[k][j]=data[r+s-1-(j-r)][c+s-1-(k-c)];
      }

  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
      data[i][j]=tmp[i][j];
  
}
int main()
{
  cin>>n>>m;
  
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
      cin>>data[i][j];
  for(int i=0;i<m;i++)
    {
      int o;
      cin>>o;
      if(o==0)
	{
	  int r,c,s,a;
	  cin>>r>>c>>s>>a;
	  r--;
	  c--;
	  for(int j=a/90;j>0;j--)
	    {
	      rotate(r,c,s);
	    }
	}
      else if(o==1)
	{//reversal
	  int r,c,s;
	  cin>>r>>c>>s;
	  r--;
	  c--;
	  for(int j=r;j<r+s;j++)
	    for(int k=c;k<c+s;k++)
	      {
	      if(data[j][k]==0)
		data[j][k]=1;
	      else
		data[j][k]=0;
	      }
	}
      else if(o==2)
	{//L_shift
	  int r;
	  cin>>r;
	  r--;
	  int tmp=data[r][0];
	  for(int i=0;i<n-1;i++)
	    data[r][i]=data[r][i+1];
	  data[r][n-1]=tmp;
	}
      else if(o==3)
	{//R_shift
	  int r;
	  cin>>r;
	  r--;
	  int tmp=data[r][n-1];
	  for(int i=n-1;i>0;i--)
	    data[r][i]=data[r][i-1];
	  data[r][0]=tmp;
	}
      else if(o==4)
	{
	  int r,c;
	  cin>>r>>c;
	  r--;c--;
	  reversal(r,c);
	}
      
    }
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
      {
	cout<<data[i][j];
	if(j!=n-1)
	  cout<<" ";
	else
	  cout<<endl;
      }
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before '{' token
    1 | {
      | ^
a.cc: In function 'int main()':
a.cc:25:3: error: 'cin' was not declared in this scope
   25 |   cin>>n>>m;
      |   ^~~
a.cc:25:8: error: 'n' was not declared in this scope
   25 |   cin>>n>>m;
      |        ^
a.cc:25:11: error: 'm' was not declared in this scope
   25 |   cin>>n>>m;
      |           ^
a.cc:29:12: error: 'data' was not declared in this scope
   29 |       cin>>data[i][j];
      |            ^~~~
a.cc:42:15: error: 'rotate' was not declared in this scope
   42 |               rotate(r,c,s);
      |               ^~~~~~
a.cc:54:18: error: 'data' was not declared in this scope
   54 |               if(data[j][k]==0)
      |                  ^~~~
a.cc:65:19: error: 'data' was not declared in this scope
   65 |           int tmp=data[r][0];
      |                   ^~~~
a.cc:75:19: error: 'data' was not declared in this scope
   75 |           int tmp=data[r][n-1];
      |                   ^~~~
a.cc:85:11: error: 'reversal' was not declared in this scope
   85 |           reversal(r,c);
      |           ^~~~~~~~
a.cc:92:9: error: 'cout' was not declared in this scope
   92 |         cout<<data[i][j];
      |         ^~~~
a.cc:92:15: error: 'data' was not declared in this scope
   92 |         cout<<data[i][j];
      |               ^~~~
a.cc:96:17: error: 'endl' was not declared in this scope
   96 |           cout<<endl;
      |                 ^~~~
Language: C++

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

int getNum(char c){
  if('A'<=c&&c<='Z')return 10+c-'A';
  if('a'<=c&&c<='z')return 36+c-'a';
  return c-'0';
}

int pto10(int p,string s){
  int res=0,x=1;
  for(int i=0;i<s.size();i++)res+=x*getNum(s[i]),x*=p;
  return res;
}

int Cnt(int num){
  int res=0;
  while(num)res++,num/=2;
  return res;
}

int main(){
  int n,p,cnt1,cnt2;
  vector<int> v;
  string s;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>p>>s;
    reverse(s.begin(),s.end());
    int num=pto10(p,s),t=0;
    while(num){
      if(num%2)t=t*10+1;
      else v.push_back(t),t=0;
      num/=2;
    }
    v.push_back(t);
  }
  for(int i=0;i<v.size();i++){
    int cnt=Cnt(v[i]);
    if(!v[i])continue;
    if(cnt==1)cnt1++;
    else cnt2++;
  }
  if(cnt2||cnt1%2)cout<<"win"<<endl;
  else cout<<"lose"<<endl;
  }
  return 0;
}

Compiler output:
a.cc:47:3: error: expected unqualified-id before 'return'
   47 |   return 0;
      |   ^~~~~~
a.cc:48:1: error: expected declaration before '}' token
   48 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
#include <cctype>
#include <tuple>
#include <iterator>
#include <bitset>
#include <random>
#include <assert.h>
#include <unordered_map>
#include <array>
#include <ctime>

#ifdef _MSC_VER
#include <agents.h>
#endif

#define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define REV(v) v.rbegin(), v.rend()
#define MEMSET(v, s) memset(v, s, sizeof(v))
#define X first
#define Y second
#define MP make_pair
#define umap unordered_map

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> P;
typedef unsigned int uint;

int s_to_dec(int base, string x){
	int res = 0;
	for (auto c : x){
		res *= base;
		if ('0' <= c && c <= '9') res += c - '0';
		if ('A' <= c && c <= 'Z') res += c - 'A' + 10;
		if ('a' <= c && c <= 'z') res += c - 'a' + 36;
	}
	return res;
}

string s_to_bin(int base, string x){
	int dec = s_to_dec(base, x);
	string res;
	while (dec){
		res += dec & 1 ? '1' : '0';
		dec /= 2;
	}
	return string(REV(res));
}

int split_xor(string s){
	int res = 0;
	int run = 0;
	for (auto c : s){
		if (c == '0'){
			res ^= run;
			run = 0;
		}
		else{
			++run;
		}
	}

	return res^run;
}

int main(){
	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	int xor = 0;
	rep(i, n){
		int base;
		string s;
		cin >> base >> s;
		xor ^= split_xor(s_to_bin(base, s));
	}
	cout << (xor ? "win" : "lose") << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:89:13: error: expected unqualified-id before 'xor' token
   89 |         int xor = 0;
      |             ^~~
a.cc:94:17: error: expected primary-expression before 'xor' token
   94 |                 xor ^= split_xor(s_to_bin(base, s));
      |                 ^~~
a.cc:94:21: error: expected primary-expression before '^=' token
   94 |                 xor ^= split_xor(s_to_bin(base, s));
      |                     ^~
a.cc:96:18: error: expected primary-expression before 'xor' token
   96 |         cout << (xor ? "win" : "lose") << endl;
      |                  ^~~
a.cc:96:22: error: expected primary-expression before '?' token
   96 |         cout << (xor ? "win" : "lose") << endl;
      |                      ^
Language: C++

#include<bits/stdc++.h>
#define N 100001
using namespace std;
typedef pair<int,int> P;
vector<P> v[N];
int n,q,a,b,c,fans,f;
string s;
int d[N];
set<P> used;

void dfs(int ans,int x){
  if(f)return;
  if(x==a){
    fans=ans;
    f=1;
    return;
  }
  for(int i=0;i<(int)v[x].size();i++){
    int nx=v[x][i].first;
    int sa=v[x][i].second;
    if(used.find(P(x,nx))!=used.end())continue;
    used.insert(P(x,nx));
    dfs(ans+sa,nx);
    v[b].push_back(P(nx,ans+sa+d[nx]-d[b]));
  }
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <string>
#define int long long
using namespace std;

int par[100000],rnk[100000];

void init(int n){
	for(int i = 0;i < n;i++){
		par[i] = i;
		rnk[i] = 0;
	}
}

int find(int x){
	if(par[x] == x) return x;
	return par[x] = find(par[x]);
}

void unite(int a,int b){
	a = find(a);
	b = find(b);
	if(a == b) return;
	if(rnk[a] > rnk[b]){
		par[b] = a;
	}else{
		par[a] = b;
		if(rnk[a] == rnk[b]) rnk[b]++;
	}
}

bool same(int a,int b){
	return find(a) == find(b);
}

int main(){
	int n,q;
	string s;
	int power[100000] = {};
	bool used[100000] = {};
	cin >> n >> q;
	init(n);
	for(int i = 0;i < q;i++){
		cin >> s;
		if(s == "COMPARE"){
			int a,b;
			cin >> a >> b; a--;b--;
			if(!used[a] || !used[b] || !same(a,b)) cout << "WARNING" << endl;
			else cout << power[b] - power[a] << endl;
		}else{
			int a,b,c;
			cin >> a >> b >> c; a--;b--;
			unite(a,b);
			if(!used[b]) power[b] = power[a] + c;
			else if(!used[a] && used[b]) power[a] = power[b] - c;
			power[a] += c;
			power[b] += c;
			used[a] = true;
			used[b] = true;
		}
	}
	return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

#define N_MAX 100000

int com[N_MAX][N_MAX];
int weight[N_MAX] = {0};

int in(int a,int b,int c)
{
  if(a>b){
    com[a-1][b-1] = 1;
    com[b-1][a-1] = weight[b-1] - weight[a-1] - c;
  }
  else{
    com[b-1][a-1] = 1;
    com[a-1][b-1] = c + weight[a-1] - weight[b-1];
  }

  weight[a-1] += c;
  weight[b-1] += c;

  return 0;
}

int main()
{
  int N,Q,a,b,c;

  int result;
  int s;
  string str("COMPARE");
  string str2("IN");

  cin>>N>>Q;

  for(int i = 0;i<Q;++i){
    string str3;
    s = 0;
    cin>>str3>>a>>b;

    if(str3 == str2){
      cin>>c;
    }

    if(str3 == str){
      if(com[b-1][a-1] == 1){
        s = 1;
        result = com[a-1][b-1] + (weight[b-1] - weight[a-1]);
        cout<<result<<endl;
      }
      else{
        for(int y = 0;y<N;++y){
          if(com[b-1][y] == 1 && com[a-1][y] == 1){
            s = 1;
            result = (com[y][a-1] + (weight[y] - weight[a-1])) + (com[y][b-1] + (weight[y] - weight[b-1]));
            cout<<result<<endl;
            break;
          }
          else if(com[b-1][y] == 1 && com[y][a-1] == 1){
            s = 1;
            result = (com[a-1][y] + (weight[y] - weight[a-1])) + (com[y][b-1] + (weight[b-1] - weight[y]));
            cout<<result<<endl;
            break;
          }
        }
      }
      if(s == 0){
        cout<<"WARNING"<<endl;
      }
    }
    else if(str3 == str2){
      in(a,b,c);
    }
  }
  return 0;
}

Compiler output:
/tmp/cckVrwol.o: in function `in(int, int, int)':
a.cc:(.text+0x5d): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cckVrwol.o
a.cc:(.text+0x77): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cckVrwol.o
a.cc:(.text+0xfc): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cckVrwol.o
a.cc:(.text+0x11c): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cckVrwol.o
a.cc:(.text+0x166): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cckVrwol.o
a.cc:(.text+0x187): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cckVrwol.o
a.cc:(.text+0x1a1): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cckVrwol.o
a.cc:(.text+0x1c2): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cckVrwol.o
/tmp/cckVrwol.o: in function `main':
a.cc:(.text+0x396): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cckVrwol.o
a.cc:(.text+0x3b0): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cckVrwol.o
a.cc:(.text+0x49d): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

#define N_MAX 100000

int com[N_MAX][N_MAX];
int weight[N_MAX] = {0};

int in(int a,int b,int c)
{
  if(a>b){
    com[a-1][b-1] = 1;
    com[b-1][a-1] = weight[b-1] - weight[a-1] - c;
  }
  else{
    com[b-1][a-1] = 1;
    com[a-1][b-1] = c + weight[a-1] - weight[b-1];
  }

  weight[a-1] += c;
  weight[b-1] += c;

  return 0;
}

int main()
{
  int N,Q,a,b,c;
  int result;
  int s;
  string str("COMPARE");
  string str2("IN");

  cin>>N>>Q;

  for(int i = 0;i<Q;++i){
    string str3;
    s = 0;
    cin>>str3>>a>>b;

    if(str3 == str2){
      cin>>c;
    }

    if(str3 == str){
      if(com[b-1][a-1] == 1){
        s = 1;
        result = com[a-1][b-1] + (weight[b-1] - weight[a-1]);
        cout<<result<<endl;
      }
      else{
        for(int y = 0;y<N;++y){
          if(com[b-1][y] == 1 && com[a-1][y] == 1){
            s = 1;
            result = (com[y][a-1] + (weight[y] - weight[a-1])) + (com[y][b-1] + (weight[y] - weight[b-1]));
            cout<<result<<endl;
            break;
          }
          else if(com[b-1][y] == 1 && com[y][a-1] == 1){
            s = 1;
            result = (com[a-1][y] + (weight[y] - weight[a-1])) + (com[y][b-1] + (weight[b-1] - weight[y]));
            cout<<result<<endl;
            break;
          }
        }
      }
      if(s == 0){
        cout<<"WARNING"<<endl;
      }
    }
    else if(str3 == str2){
      in(a,b,c);
    }
  }
  return 0;
}

Compiler output:
/tmp/cci26Pih.o: in function `in(int, int, int)':
a.cc:(.text+0x5d): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cci26Pih.o
a.cc:(.text+0x77): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cci26Pih.o
a.cc:(.text+0xfc): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cci26Pih.o
a.cc:(.text+0x11c): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cci26Pih.o
a.cc:(.text+0x166): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cci26Pih.o
a.cc:(.text+0x187): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cci26Pih.o
a.cc:(.text+0x1a1): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cci26Pih.o
a.cc:(.text+0x1c2): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cci26Pih.o
/tmp/cci26Pih.o: in function `main':
a.cc:(.text+0x396): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cci26Pih.o
a.cc:(.text+0x3b0): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cci26Pih.o
a.cc:(.text+0x49d): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

#define N_MAX 100000

int com[N_MAX][N_MAX] = 0;
int weight[N_MAX] = {0};

int in(int a,int b,int c)
{
  if(a>b){
    com[a-1][b-1] = 1;
    com[b-1][a-1] = weight[b-1] - weight[a-1] - c;
  }
  else{
    com[b-1][a-1] = 1;
    com[a-1][b-1] = c + weight[a-1] - weight[b-1];
  }

  weight[a-1] += c;
  weight[b-1] += c;

  return 0;
}

int main()
{
  int N,Q,a,b,c;
  int result;
  int s;
  string str("COMPARE");
  string str2("IN");
  string str4("WARNING");
  cin>>N>>Q;

  for(int i = 0;i<Q;++i){
    string str3;
    s = 0;
    cin>>str3>>a>>b;

    if(str3 == str2){
      cin>>c;
    }

    if(str3 == str){
      if(com[b-1][a-1] == 1){
        s = 1;
        result = com[a-1][b-1] + (weight[b-1] - weight[a-1]);
        cout<<result<<endl;
      }
      else{
        for(int y = 0;y<N;++y){
          if(com[b-1][y] == 1 && com[a-1][y] == 1){
            s = 1;
            result = (com[y][a-1] + (weight[y] - weight[a-1])) + (com[y][b-1] + (weight[y] - weight[b-1]));
            cout<<result<<endl;
            break;
          }
          else if(com[b-1][y] == 1 && com[y][a-1] == 1){
            s = 1;
            result = (com[a-1][y] + (weight[y] - weight[a-1])) + (com[y][b-1] + (weight[b-1] - weight[y]));
            cout<<result<<endl;
            break;
          }
        }
      }
      if(s == 0){
	cout<<str4<<endl;
      }
    }
    else if(str3 == str2){
      in(a,b,c);
    }
  }
  return 0;
}

Compiler output:
a.cc:9:25: error: array must be initialized with a brace-enclosed initializer
    9 | int com[N_MAX][N_MAX] = 0;
      |                         ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

#define N_MAX 100000

int com[N_MAX][N_MAX] = {0};
int weight[N_MAX] = {0};

int in(int a,int b,int c)
{
  if(a>b){
    com[a-1][b-1] = 1;
    com[b-1][a-1] = weight[b-1] - weight[a-1] - c;
  }
  else{
    com[b-1][a-1] = 1;
    com[a-1][b-1] = c + weight[a-1] - weight[b-1];
  }

  weight[a-1] += c;
  weight[b-1] += c;

  return 0;
}

int main()
{
  int N,Q,a,b,c;
  int result;
  int s;
  string str("COMPARE");
  string str2("IN");
  string str4("WARNING");
  cin>>N>>Q;

  for(int i = 0;i<Q;++i){
    string str3;
    s = 0;
    cin>>str3>>a>>b;

    if(str3 == str2){
      cin>>c;
    }

    if(str3 == str){
      if(com[b-1][a-1] == 1){
        s = 1;
        result = com[a-1][b-1] + (weight[b-1] - weight[a-1]);
        cout<<result<<endl;
      }
      else{
        for(int y = 0;y<N;++y){
          if(com[b-1][y] == 1 && com[a-1][y] == 1){
            s = 1;
            result = (com[y][a-1] + (weight[y] - weight[a-1])) + (com[y][b-1] + (weight[y] - weight[b-1]));
            cout<<result<<endl;
            break;
          }
          else if(com[b-1][y] == 1 && com[y][a-1] == 1){
            s = 1;
            result = (com[a-1][y] + (weight[y] - weight[a-1])) + (com[y][b-1] + (weight[b-1] - weight[y]));
            cout<<result<<endl;
            break;
          }
        }
      }
      if(s == 0){
	cout<<str4<<endl;
      }
    }
    else if(str3 == str2){
      in(a,b,c);
    }
  }
  return 0;
}

Compiler output:
/tmp/cc44ZssC.o: in function `in(int, int, int)':
a.cc:(.text+0x5d): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cc44ZssC.o
a.cc:(.text+0x77): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cc44ZssC.o
a.cc:(.text+0xfc): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cc44ZssC.o
a.cc:(.text+0x11c): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cc44ZssC.o
a.cc:(.text+0x166): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cc44ZssC.o
a.cc:(.text+0x187): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cc44ZssC.o
a.cc:(.text+0x1a1): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cc44ZssC.o
a.cc:(.text+0x1c2): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cc44ZssC.o
/tmp/cc44ZssC.o: in function `main':
a.cc:(.text+0x3ca): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cc44ZssC.o
a.cc:(.text+0x3e4): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cc44ZssC.o
a.cc:(.text+0x4d1): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int com[100000][100000];
int weight[100000] = {0};

int in(int a,int b,int c)
{
  if(a>b){
    com[a-1][b-1] = 1;
    com[b-1][a-1] = weight[b-1] - weight[a-1] - c;
  }
  else{
    com[b-1][a-1] = 1;
    com[a-1][b-1] = c + weight[a-1] - weight[b-1];
  }
  weight[a-1] += c;
  weight[b-1] += c;

  return 0;
}

int main()
{
  int N,Q,a,b,c;
  int result;
  int s;
  string str("COMPARE");
  string str2("IN");
  string str4("WARNING");

  cin>>N>>Q;

  for(int i = 0;i<Q;++i){
    string str3;
    s = 0;
    cin>>str3>>a>>b;

    if(str3 == str2){
      cin>>c;
    }
    if(str3 == str){
      if(com[b-1][a-1] == 1){
        s = 1;
        result = com[a-1][b-1] + (weight[b-1] - weight[a-1]);
        cout<<result<<endl;
      }
      else{
        for(int y = 0;y<N;++y){
          if(com[b-1][y] == 1 && com[a-1][y] == 1){
            s = 1;
            result = (com[y][a-1] + (weight[y] - weight[a-1])) + (com[y][b-1] + (weight[y] - weight[b-1]));
            cout<<result<<endl;
            break;
          }
          else if(com[b-1][y] == 1 && com[y][a-1] == 1){
            s = 1;
            result = (com[a-1][y] + (weight[y] - weight[a-1])) + (com[y][b-1] + (weight[b-1] - weight[y]));
            cout<<result<<endl;
            break;
          }
        }
      }
      if(s == 0){
        cout<<str4<<endl;
      }
    }
    else if(str3 == str2){
      in(a,b,c);
    }
  }
  return 0;
}

Compiler output:
/tmp/cchblXal.o: in function `in(int, int, int)':
a.cc:(.text+0x5d): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cchblXal.o
a.cc:(.text+0x77): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cchblXal.o
a.cc:(.text+0xfc): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cchblXal.o
a.cc:(.text+0x11c): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cchblXal.o
a.cc:(.text+0x166): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cchblXal.o
a.cc:(.text+0x187): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cchblXal.o
a.cc:(.text+0x1a1): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cchblXal.o
a.cc:(.text+0x1c2): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cchblXal.o
/tmp/cchblXal.o: in function `main':
a.cc:(.text+0x3ca): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cchblXal.o
a.cc:(.text+0x3e4): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/cchblXal.o
a.cc:(.text+0x4d1): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <string>

using namespace std;

int com[100000][100000];
int weight[100000] = {0};

int main()
{
  int N,Q,a,b,c;
  int result;
  int s;
  string str("COMPARE");
  string str2("IN");
  string str4("WARNING");

  cin>>N>>Q;

  for(int i = 0;i<Q;++i){
    string str3;
    s = 0;
    cin>>str3>>a>>b;

    if(str3 == str){
      if(com[b-1][a-1] == 1){
        s = 1;
        result = com[a-1][b-1] + (weight[b-1] - weight[a-1]);
      } 
      else{
        for(int y = 0;y<N;++y){
          if(com[b-1][y] == 1 && com[a-1][y] == 1){
            s = 1;
            result = (com[y][a-1] + (weight[y] - weight[a-1])) + (com[y][b-1] + (weight[y] - weight[b-1]));
            break;
          }
          else if(com[b-1][y] == 1 && com[y][a-1] == 1){
            s = 1;
            result = (com[a-1][y] + (weight[y] - weight[a-1])) + (com[y][b-1] + (weight[b-1] - weight[y]));
            break;
          }
        }
      }
      if(s == 0){
        cout<<str4<<endl;
      }
      else{
        cout<<result<<endl;
      }
    }
    else if(str3 == str2){
      cin>>c;

      if(a>b){
        com[a-1][b-1] = 1;
        com[b-1][a-1] = weight[b-1] - weight[a-1] - c;
      }
      else{
        com[b-1][a-1] = 1;
        com[a-1][b-1] = c + weight[a-1] - weight[b-1];
      }
      weight[a-1] += c;
      weight[b-1] += c;
    }
  }
  return 0;
}

Compiler output:
/tmp/ccsfnTtC.o: in function `main':
a.cc:(.text+0x1c3): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccsfnTtC.o
a.cc:(.text+0x1dd): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccsfnTtC.o
a.cc:(.text+0x2a4): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccsfnTtC.o
a.cc:(.text+0x2be): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccsfnTtC.o
a.cc:(.text+0x304): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccsfnTtC.o
a.cc:(.text+0x31e): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccsfnTtC.o
a.cc:(.text+0x3db): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccsfnTtC.o
a.cc:(.text+0x3f5): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccsfnTtC.o
a.cc:(.text+0x43e): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccsfnTtC.o
a.cc:(.text+0x455): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccsfnTtC.o
a.cc:(.text+0x562): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#error "trurai"

#include <vector>
#include <iostream>
#include <complex>
#include <cmath>
using namespace std;
typedef complex<double> P;
#define X real()
#define Y imag()

const double pi = acos(-1);

double dot(P a, P b){
  return a.X*b.X + a.Y*b.Y;
}

bool in_sector(P c, double r, double theta, double a, double b){
  if(abs(c) + r > a) return false;
  P d = P(cos(b/2.0), sin(b/2.0)), n = d*P(0,1);
  P lb = c + r*n, ub = c - r*n;
  if(dot(d, lb)/abs(lb) > cos(theta/2.0)) return false;
  if(dot(d, ub)/abs(ub) > cos(theta/2.0)) return false;
  return true;
}

void dfs(vector< vector<int> > &G, int v, vector<int> &P, vector<int> &R){
  for(int i = 0; i < (int)G[v].size(); ++i){
    int v_ = G[v][i];
    int d = min(P[v_], R[v_]+R[v]) - R[v_];
    R[v_] += d;
    if(d) dfs(G, v_, P, R);
  }
}

int solve(vector< vector<int> > &G, vector<int> P){
  int n = G.size();
  vector<int> R(n, 0);
  R[0] = P[0];
  dfs(G, 0, P, R);
  return R.back();
}

int main(){
  int N;
  cin >> N;
  double theta, a;
  vector<int> Power(N+2, 0);
  cin >> theta >> a >> Power[0];
  theta *= pi/180.0;
  vector<P> L(N+1);
  vector<double> R(N+1), A(N);
  vector<double> T(N), B(N);
  for(int i = 0; i < N; ++i){
    double x, y;
    cin >> x >> y >> R[i] >> T[i] >> A[i] >> B[i] >> Power[i+1];
    L[i] = P(x, y);
    T[i] /= 180.0/pi;
    B[i] /= 180.0/pi;
  }
  double x, y;
  cin >> x >> y >> R[N];
  L[N] = P(x, y);
  vector< vector<int> > G(N+2);
  for(int i = 0; i < N; ++i){
    for(int j = 0; j <= N; ++j){
      if(in_sector(L[j]-L[i], R[j], T[i], A[i], B[i])) G[i+1].push_back(j+1);
    }
  }
  for(int i = 0; i < N; ++i){
    for(int j = 0; j < (int)G[i].size(); ++j) cout << G[i][j] << " ";cout << endl;
  }
  int ans = 0;
  for(int i = 0; i < N; ++i){
    if(R[i] > a) continue;
    P n = P(-sin(B[i]), cos(B[i])), lb = L[i] - n*R[i];
    lb *= a/abs(lb);
    double b = arg(lb) + theta/2.0;
    for(int j = 0; j < N; ++j){
      if(in_sector(L[i], R[i], theta, a, b)){
        G[0].push_back(i+1);
      }
    }
    ans = max(ans, solve(G, Power));
  }
  cout << ans << endl;
  return 0;
}



Compiler output:
a.cc:1:2: error: #error "trurai"
    1 | #error "trurai"
      |  ^~~~~
Language: C

#include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
int W,H;
char mp[22][22];
int vis[22][22];
int stx,sty;
int ans;
struct Node{
	int x,y;
	Node(int xx,int yy):x(xx),y(yy){}
};
queue<Node> Q;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
bool check(int x,int y){
	return x>=0&&y>=0&&x<H&&y<W;
}
void bfs(){
	memset(vis,0,sizeof vis);
	while(!Q.empty()) Q.pop();
	Q.push(Node(stx,sty));
	vis[stx][sty]=1;
	ans = 1;
	while(!Q.empty()){
		Node st = Q.front();
		Q.pop();
		for(int i=0;i<4;i++){
			int tx = st.x+dx[i];
			int ty = st.y+dy[i];
			if(check(tx,ty)&&mp[tx][ty]!='#'&&vis[tx][ty]==0){
				vis[tx][ty]=1;
				Q.push(Node(tx,ty));
				ans++;
			}
		}
	}
	printf("%d\n",ans);
}
int main(int argc,char **argv){
	while(scanf("%d%d",&W,&H)!=EOF&&(W||H)){
		for(int i=0;i<H;i++){
			scanf("%s",mp[i]);
			for(int j=0;j<W;j++){
				if(mp[i][j]=='@'){
					stx=i;
					sty=j;
				}
			}
		}
		bfs();
	}
	return 0;
}


Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C++

int main(){
  int n;
  cin >> n;
  if(n == 1) cout << 1 << endl;
  if(n == 2) cout << 2 << endl;
  if(n == 3) cout << 4 << endl;
  if(n == 4) cout << 6 << endl;
  if(n == 12) cout << 7 << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> n;
      |   ^~~
a.cc:4:14: error: 'cout' was not declared in this scope
    4 |   if(n == 1) cout << 1 << endl;
      |              ^~~~
a.cc:4:27: error: 'endl' was not declared in this scope
    4 |   if(n == 1) cout << 1 << endl;
      |                           ^~~~
a.cc:5:14: error: 'cout' was not declared in this scope
    5 |   if(n == 2) cout << 2 << endl;
      |              ^~~~
a.cc:5:27: error: 'endl' was not declared in this scope
    5 |   if(n == 2) cout << 2 << endl;
      |                           ^~~~
a.cc:6:14: error: 'cout' was not declared in this scope
    6 |   if(n == 3) cout << 4 << endl;
      |              ^~~~
a.cc:6:27: error: 'endl' was not declared in this scope
    6 |   if(n == 3) cout << 4 << endl;
      |                           ^~~~
a.cc:7:14: error: 'cout' was not declared in this scope
    7 |   if(n == 4) cout << 6 << endl;
      |              ^~~~
a.cc:7:27: error: 'endl' was not declared in this scope
    7 |   if(n == 4) cout << 6 << endl;
      |                           ^~~~
a.cc:8:15: error: 'cout' was not declared in this scope
    8 |   if(n == 12) cout << 7 << endl;
      |               ^~~~
a.cc:8:28: error: 'endl' was not declared in this scope
    8 |   if(n == 12) cout << 7 << endl;
      |                            ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
          int N;
	cin>>N;
if(N==1)
 cout<<1<<endl;
else if(N==2)
 cout<<2<<endl;
else if(N==3)
 cout<<4<<endl;
else if(N==4)
 cout<<6<<endl;
else if(N==5)
 cout<<16<<endl;
else if(N==6)
 cout<<12<<endl;
else if(N==7)
 cout<<64<<endl;
else if(N==8)
 cout<<24<<endl;
else if(N==9)
 cout<<36<<endl;
else if(N==10)
 cout<<48<<endl;
else if(N==11)
 cout<<1024<<endl;
else (N==12)
 cout<<72<<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:13: error: expected ';' before 'cout'
   30 | else (N==12)
      |             ^
      |             ;
   31 |  cout<<72<<endl;
      |  ~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
          int N;
	cin>>N;
if(N==1)
 cout<<1<<endl;
else if(N==2)
 cout<<2<<endl;
else if(N==3)
 cout<<4<<endl;
else if(N==4)
 cout<<6<<endl;
else if(N==5)
 cout<<16<<endl;
else if(N==6)
 cout<<12<<endl;
else if(N==7)
 cout<<64<<endl;
else if(N==8)
 cout<<24<<endl;
else if(N==9)
 cout<<36<<endl;
else if(N==10)
 cout<<48<<endl;
else if(N==11)
 cout<<1024<<endl;
else if(N==12)
 cout<<72<<endl;
  else cout<""<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:15: error: invalid operands of types 'const char [1]' and '<unresolved overloaded function type>' to binary 'operator<<'
   32 |   else cout<""<<endl;
      |             ~~^~~~~~
Language: C++

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




int main(){
  int n;
  cin>>n;
  int a[5]={2,3,5,7,11};
  vector<int> s(0);
  int i=2;
  while(n!=1){
    if(n%i==0){s.push_back(i); continue;}
    i++;
  }
  int b[5]={};
  for(int i=0;i<s.size();i++){
    b[i]=s[i]-1;
  }
  sort(b,b+5);
  reverse(b,b+5);
  int ans=1;
  for(int i=0;i<5;i++){
    a*=pow(a[i],b[i]);
  }
  cout<<ans<<endl;



  
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:6: error: invalid operands of types 'int [5]' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator*'
   25 |     a*=pow(a[i],b[i]);
      |     ~^~~~~~~~~~~~~~~~
a.cc:25:6: note:   in evaluation of 'operator*=(int [5], __gnu_cxx::__promote<double>::__type {aka double})'
Language: C++

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

int main(){
  int a[13] = {1 , 2 , 3 , 5 , 7 , 11 , 13 , 17 ,19 , 23 , 29 , 31 };

  int b;
  b = 1;
  for(int i= 0,i<n;i++){
    b = b * a[i];

  }

  cout << b << endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected ';' before '<' token
    9 |   for(int i= 0,i<n;i++){
      |                 ^
      |                 ;
a.cc:9:17: error: expected primary-expression before '<' token
a.cc:9:18: error: 'n' was not declared in this scope
    9 |   for(int i= 0,i<n;i++){
      |                  ^