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

#include<iostream>
using namesoace std;

int main(){
	int N;
	cin>>N;
	int player[N+1];
	int all;
	int num=1;
	for(int i=1;i<101;i++){
		char x;
		cin>>x;
		if(x=='M'){
			player[num]+=1;
			num++;
			if(num=>6){
				num=1;
			}
		}
		if(x=='S'){
			all+=player[num];
			player[num]=0;
			num++;
			if(num=>6){
				num=1;
			}
		}
		if(x=='L'){
			player[num]+=1+all;
			all=0;
			num++;
			if(num=>6){
				num=1;
			}
		}
	}
	for(int i=1;i<N+1;i++){
		cout<<player[i]<<" ";
	}
	cout<<all<<endl;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesoace'
    2 | using namesoace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin>>N;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:16:32: error: expected primary-expression before '>' token
   16 |                         if(num=>6){
      |                                ^
a.cc:24:32: error: expected primary-expression before '>' token
   24 |                         if(num=>6){
      |                                ^
a.cc:32:32: error: expected primary-expression before '>' token
   32 |                         if(num=>6){
      |                                ^
a.cc:38:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   38 |                 cout<<player[i]<<" ";
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:40:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   40 |         cout<<all<<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:40:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   40 |         cout<<all<<endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main(){
 while(true){
	int N;
	cin>>N;

	if(N==0)break;

	int n[10]=[0];
	int m=0;

	for(int i=0;i<100;i++){
		char c;
		cin>>c;

		n[i%N]++;

		if(c=='S'){
			m+=n[i%N];
			n[i%N]=0;
		}else if(c=='L'){
			n[i%N]+=m;
			m=0;
		}

	}
	sort(n,n+N);

	for(int i=0;i<N;i++){
		cout<<n[i]<<' ';
 	}
 	cout<<m<<endl;
 }
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected identifier before numeric constant
   12 |         int n[10]=[0];
      |                    ^
a.cc: In lambda function:
a.cc:12:22: error: expected '{' before ';' token
   12 |         int n[10]=[0];
      |                      ^
a.cc: In function 'int main()':
a.cc:12:19: error: array must be initialized with a brace-enclosed initializer
   12 |         int n[10]=[0];
      |                   ^~~
Language: C++

#include<stdio.h>
#include<conio.h>


#include<algorithm>

using namespace std ;


int main()
{
	int n ;

	while( 1 )
	{
		scanf( "%d" ,&n ) ;

		if( n == 0 )
		{
			return 0 ;
		}


		int player[ 10 ] = { 0 } ;
		int ba = 0 ;


		int i = 0 ;
		while( i < 100 )
		{
			int p = i % n ;


			switch( getch() )
			{
				case 'L' :

					player[ p ] += ba ;

					ba = 0 ;


				case 'M' :

					++player[ p ] ;

					break ;


				default :

					ba += player[ p ] + 1 ;

					player[ p ] = 0 ;
			}

			++i ;
		}


		sort( player ,player + n ) ;


		i = 0 ;
		while( n-- )
		{
			printf( "%d " ,player[ i++ ] ) ;
		}

		printf( "%d\n" ,ba ) ;
	}
}

Compiler output:
a.cc:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

//
//  main.cpp
//  pck2013
//
//  Created by Wanikawa on 2013/09/14.
//  Copyright (c) 2013年 Wanikawa. All rights reserved.
//

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

int main()
{
    /*
     hitogagominoyouda
     */
    while (1) {
        int num,feeld = 0;
        int play[10] = {0};
        string crad;
        
        cin >> num;
        if (num == 0) break;
        cin >> crad;
        //cout << crad;
        
        int pt = 0;
        while (pt < 100) {
            for (int i = 0; i < num; i++) {
                if (pt > 100) break;
                if (crad[pt] == 'M') {
                    play[i]++;
                }
                if (crad[pt] == 'S') {
                    feeld++;
                    feeld += play[i];
                    play[i] = 0;
                }
                if (crad[pt] == 'L') {
                    play[i] = play[i] + feeld + 1;
                    feeld = 0;
                }
                pt++;
            }
        }
        
        vector<int> p;
        for (int i = 0; i < num; i++) {
            p.push_back(play[i]);
        }
        sort(p.begin(), p.end());
        
        for (int i = 0; i < num; i++) {
            cout << p[i] << " ";
        }
        cout << feeld << endl;
    }
    
    return 0;
}

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

#include<stdio.h>

int main(void)
{
	int n,a,i,pl=1,fl=0;
	int p[101]={0};
	char s;
	while(0==0){
		scanf("%d",&n);
		if(n==0)break;
		for(i==0;i<100;i++){
			scanf("%c",&s);
			if(s =='S'){
				fl+=p[pl]+1;
				p[pl]=0;
			}else if(s =='M')p[pl]+=1;
			else if(s =='L'){
				p[pl]+=fl+1;
				fl=0;
			}
		pl++;
		if(pl>n)pl=1;
	}
	return 0;
}

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

#define _USE_MATH_DEFINES
#define INF 10000000
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

typedef long long ll;
typedef pair<int,string> P;

static const double EPS = 1e-8;

int main(){
  int N;
  while(~scanf("%d",&N)){
    if(N == 0) break;
    char cards[101];
    scanf("%s",cards);
    
    int card_idx = 0;
    int players[11];
    memset(players.0,sizeof(players));

    int field = 0;
    for(int round=0;round < 100; round++){
      for(int player_idx=0;player_idx < N; player_idx++){
	if(cards[card_idx] == 'M'){
	  players[player_idx]++;
	}
	else if(cards[card_idx] == 'S'){
	  field += player_idx[player_idx] + 1;
	  player_idx[player_idx] = 0;
	}
	else if(cards[card_idx] == 'L'){
	  player_idx[player_idx] += field + 1;
	}
	card_idx++;
      }
    }

    sort(players,players + N);
    for(int i=0;i<N;i++){
      printf("%d ",players[player_idx]);
    }
    printf("%d\n",field);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:19: error: expected ')' before numeric constant
   35 |     memset(players.0,sizeof(players));
      |           ~       ^~
      |                   )
a.cc:35:11: error: too few arguments to function 'void* memset(void*, int, size_t)'
   35 |     memset(players.0,sizeof(players));
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstring:43,
                 from a.cc:13:
/usr/include/string.h:61:14: note: declared here
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |              ^~~~~~
a.cc:44:30: error: invalid types 'int[int]' for array subscript
   44 |           field += player_idx[player_idx] + 1;
      |                              ^
a.cc:45:21: error: invalid types 'int[int]' for array subscript
   45 |           player_idx[player_idx] = 0;
      |                     ^
a.cc:48:21: error: invalid types 'int[int]' for array subscript
   48 |           player_idx[player_idx] += field + 1;
      |                     ^
a.cc:56:28: error: 'player_idx' was not declared in this scope; did you mean 'players'?
   56 |       printf("%d ",players[player_idx]);
      |                            ^~~~~~~~~~
      |                            players
Language: Java

import java.util.*;
				
public class mon6{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int R = 0;
		R = scan.nextInt();
		for(int k = 1;k<=R;k++){
			int count = 0;
			int C = scan.nextInt();
			int A = scan.nextInt();
			int N = scan.nextInt();
			while(true){
				if(N != 0 && A != 0 && C != 0){
					count = count + 1;
					C = C - 1;
					A = A - 1;
					N = N - 1;
				}else
				if(A != 0 && C >= 2){
					count = count + 1;
					C = C - 2;
					A = A - 1;
				}else
				if(C >= 3){
					count = count + 1;
					C = C - 3;
				}else
				if(C <= 2){
					break;
				}
			}
				System.out.println(count);
		}
	}
}

Compiler output:
Main.java:3: error: class mon6 is public, should be declared in a file named mon6.java
public class mon6{
       ^
1 error
Language: C

#include <stdio.h>
int main (void)
{
int a;
scanf("%d",&a);
   
int b[100][3]={};
int i;
int j;
int k=0;
   
for(i=0;i<a;i++){
for(j=0;j<3;j++)
scanf("%d",&b[i][j]);
   
int b2[3]={};
   
int c=0;  
 
b2[0]=b[i][0];
b2[1]=b[i][1];
b2[2]=b[i][2];
   
while(1){
b2[0]-=1;
b2[1]-=1;
b2[2]-=1;
if(b2[0]<0||b2[1]<0||b2[2]<0)
break;
c++;
     
while(1){
b2[0]-=2;
b2[1]-=1;
if(b2[0]<0||b2[1]<0)
break;
c++;
}
   
while(1){
b2[0]-=3;
if(b2[0]<0)
break;
c++;
}
   printf("%d\n",c);
}
   
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:50:1: error: expected declaration or statement at end of input
   50 | }
      | ^
Language: C

#include <stdio.h>

int main(void)
{
	int i,ii,y,c,a,n,sum,ans;
	scanf("%d",&y);
	for(i=0;i<y;i++){
		scanf("%d%d%d",&c,&a,&n);
		if(c==0){
			printf("0\n");
		}else{
			sum=c+a+n;
			for(ii=0;ii<c;ii++){
				sum=sum-3;
				if(sum>0){
				ans++;
				}else break
			}
			printf("%d\n",ans);
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:44: error: expected ';' before '}' token
   17 |                                 }else break
      |                                            ^
      |                                            ;
   18 |                         }
      |                         ~
Language: C

#define m(a,b)(a<b?a:b)
r;main(c,a,n){for(gets(&c);r=~scanf("%d%d%d",&c,&a,&n);printf("%d\n",r+n+(c-n*2)/3))r=m(c,m(a,n)),c-=r,a-=r,n=min(c/2,a);}

Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | r;main(c,a,n){for(gets(&c);r=~scanf("%d%d%d",&c,&a,&n);printf("%d\n",r+n+(c-n*2)/3))r=m(c,m(a,n)),c-=r,a-=r,n=min(c/2,a);}
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int]
main.c:2:3: error: return type defaults to 'int' [-Wimplicit-int]
    2 | r;main(c,a,n){for(gets(&c);r=~scanf("%d%d%d",&c,&a,&n);printf("%d\n",r+n+(c-n*2)/3))r=m(c,m(a,n)),c-=r,a-=r,n=min(c/2,a);}
      |   ^~~~
main.c: In function 'main':
main.c:2:3: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:2:3: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:2:3: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:2:19: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    2 | r;main(c,a,n){for(gets(&c);r=~scanf("%d%d%d",&c,&a,&n);printf("%d\n",r+n+(c-n*2)/3))r=m(c,m(a,n)),c-=r,a-=r,n=min(c/2,a);}
      |                   ^~~~
main.c:2:31: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 | r;main(c,a,n){for(gets(&c);r=~scanf("%d%d%d",&c,&a,&n);printf("%d\n",r+n+(c-n*2)/3))r=m(c,m(a,n)),c-=r,a-=r,n=min(c/2,a);}
      |                               ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define m(a,b)(a<b?a:b)
main.c:2:31: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 | r;main(c,a,n){for(gets(&c);r=~scanf("%d%d%d",&c,&a,&n);printf("%d\n",r+n+(c-n*2)/3))r=m(c,m(a,n)),c-=r,a-=r,n=min(c/2,a);}
      |                               ^~~~~
main.c:2:31: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:56: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    2 | r;main(c,a,n){for(gets(&c);r=~scanf("%d%d%d",&c,&a,&n);printf("%d\n",r+n+(c-n*2)/3))r=m(c,m(a,n)),c-=r,a-=r,n=min(c/2,a);}
      |                                                        ^~~~~~
main.c:2:56: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:56: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:2:56: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:111: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
    2 | r;main(c,a,n){for(gets(&c);r=~scanf("%d%d%d",&c,&a,&n);printf("%d\n",r+n+(c-n*2)/3))r=m(c,m(a,n)),c-=r,a-=r,n=min(c/2,a);}
      |                                                                                                               ^~~
      |                                                                                                               main
Language: C++

#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <queue>
#define rep(i,n) for(int i = 0; i < n; ++i)
#define rrep(i,n) for(int i = 1; i <= n; ++i)
using namespace std;
typedef pair<int,int> P;
const int INF = 1000000000;


int c,a,n;



int main(){
	int q;
	scanf("%d",&q);
	rep(i,n){
		scanf("%d%d%d",&c,&a,&n);
		int ans = 0,temp;
		
		temp = min(c,min(a,n));
		ans += temp;
		a-=temp;
		c-=temp;
		
		temp = min(c/2,a);
		ans += temp;
		a -= temp;
		
		ans + = c/3;
		
		printf("%d\n",ans);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:23: error: expected primary-expression before '=' token
   33 |                 ans + = c/3;
      |                       ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include <time.h>

using namespace std ;

int main()
{
  int N ,c,a,n ;
  vector< int > ans;
  cin >> N ;
  ans.assign( N, 0) ;
  for( int i = 0 ; i < N ; ++i )
  {
    cin >> c >> a >> n ;
    if(c <= a && c <= n)
    {
      ans[i] += c ;
      c = 0 ;
    }
    else if(a > n && c > n)
    {
      ans[i] += n ;
      c -= n ;
      a -= n ;
    }
    else if( n > a && c > a )
    {
      ans[i] += a ;
      c -= a ;
      a = 0 ;
    }
    if(a != 0)
    {
      if(a <= c / 2)
      {
        ans[i] += a ;
        c -= a * 2 ;
      }
      else
      {
        ans[i] += c / 2 ;
        c = 0 ;
      }
    }
    ans[i] += c / 3 ;
    for(int i = 0; i < N; ++i){
      cout << ans[i]<<endl;
    }
  }
  return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'vector' was not declared in this scope
   11 |   vector< int > ans;
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include<algorithm>
  +++ |+#include <vector>
    3 | #include<string>
a.cc:11:11: error: expected primary-expression before 'int'
   11 |   vector< int > ans;
      |           ^~~
a.cc:13:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |   ans.assign( N, 0) ;
      |   ^~~
      |   abs
Language: C++

#include <iostream>
using namespace std;
int main(){
  int Q;
  cin>>Q;
  for(int i=0;i<Q;i++){
    int c,a,n,can=0,cca=0,ccc=0;
    cin>>c>>a>>n;
    for(int j=0;j<c;j++){
      if(1<=n&&1<=a&&1<=c){
        can=n;
        a=a-n; c=c-n; n=0;
      }
      if(1<=a&&1<=c/2){
        cca=a;
        c=c-a*2; a=0
      }

  
      if(1<=c/3){
        ccc=c/3; c=0;
      }
    }
    cout<<can+cca+ccc<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: expected ';' before '}' token
   16 |         c=c-a*2; a=0
      |                     ^
      |                     ;
   17 |       }
      |       ~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int Q;
  cin>>Q;
  for(int i=0;i<Q;i++){
    int c,a,n,can=0,cca=0,ccc=0;
    cin>>c>>a>>n;
      if(1<=n&&1<=a&&1<=c){
        can=n;
        a=a-n; c=c-n; n=0;
      }
      else if(1<=a&&1<=c/2){
        cca=a;
        c=c-a*2; a=0;
      }

  
      else if(1<=c/3){
        ccc=c/3; c=0;
      }
    }
    cout<<can+cca+ccc<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: error: 'can' was not declared in this scope; did you mean 'scanf'?
   23 |     cout<<can+cca+ccc<<endl;
      |           ^~~
      |           scanf
a.cc:23:15: error: 'cca' was not declared in this scope
   23 |     cout<<can+cca+ccc<<endl;
      |               ^~~
a.cc:23:19: error: 'ccc' was not declared in this scope
   23 |     cout<<can+cca+ccc<<endl;
      |                   ^~~
a.cc: At global scope:
a.cc:25:3: error: expected unqualified-id before 'return'
   25 |   return 0;
      |   ^~~~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include<iostream>
#include<algorithm>

int mymin(int a, int b, int c) {
	int tmp = min(a, b);
	return min(tmp, c);
}

using namespace std;

int main() {
	int q;
	cin >> q;
	for (int i = 0; i < q; i++) {
		int c, a, n, ct = 0;
		cin >> c >> a >> n;
		ct += mymin( c ,a ,n );
		c -= ct, a -= ct, n -= ct;
		if (a > 0 && c > 0 && a * 2 > c)ct += (c / 2);
		else if (a > 0 && c > 0 && a * 2 < c)ct += (a + ((c - a * 2) / 3));
		cout << ct << endl;

	}
	return 0;
}

Compiler output:
a.cc: In function 'int mymin(int, int, int)':
a.cc:5:19: error: 'min' was not declared in this scope; did you mean 'std::min'?
    5 |         int tmp = min(a, b);
      |                   ^~~
      |                   std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

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

struct Team{
  int c;
  int a;
  int n;
  int TeamNum;
  Team(){
    c=0;
    a=0;
    n=0;
    TeamNum=0;
  }
};

void Clear(Team& a,Team& b){
  a.c = b.c;
  a.a = b.a;
  a.n = b.n;
  a.TeamNum = b.TeamNum;
}

int main(){


    int Q = 0;

    cin >> Q;

    for(int i=0; i<Q; i++){
        int c,a,n;

        cin >> c >> a >> n;

        if(c == 0 || (c < 2 && a == 0) || (c == 0 && a == 0 && n == 0))

        int answer = 0;

        queue<Team> que;

        while(!que.empty()){
          que.pop();
        }

        Team tmp;

        tmp.c = c;
        tmp.a = a;
        tmp.n = n;
        tmp.TeamNum = 0;

        que.push(tmp);

        while(!que.empty()){
          tmp = que.front();
          que.pop();

          if(tmp.c < 0 || tmp.a < 0 || tmp.n < 0){
            tmp.TeamNum--;
            if(answer < tmp.TeamNum){
              answer = tmp.TeamNum;
            }
            continue;
          }

          tmp.TeamNum += 1;

          Team beforetmp;

          Clear(beforetmp,tmp);

          tmp.c -= 3;

          que.push(tmp);

          Clear(tmp,beforetmp);

          tmp.c -= 2;
          tmp.a -= 1;

          que.push(tmp);

          Clear(tmp,beforetmp);

          tmp.c--;
          tmp.a--;
          tmp.n--;

          que.push(tmp);

        }

        cout << answer << endl;

    }


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:16: error: 'answer' was not declared in this scope
   62 |             if(answer < tmp.TeamNum){
      |                ^~~~~~
a.cc:95:17: error: 'answer' was not declared in this scope
   95 |         cout << answer << endl;
      |                 ^~~~~~
Language: C++

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

int main(){
	int Q;
	cijn>>Q;
	for(int i=0;i<Q;i++){
		int c,a,n;
		cin>>c>>a>>n;
		int can=min(min(c,a),n);
		c-=can;
		a-=can;
		int cca=min(c/2,a);
		c-=cca*2;
		int ccc=c/3;
		cout<<can+cca+ccc<<endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cijn' was not declared in this scope
    7 |         cijn>>Q;
      |         ^~~~
Language: C++

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

int main()
{
		int N;
		cin>>N;

		for(int i=0;i<100;i++){
			int c,a,n;
			int can=min(min(c,a),n);
			c-=can;
			a-=can;
			
			int cca=min(c?2,a);
			c-=cca*2;
			int ccc=c/3;

			cout<<can+cca+ccc<<endl;
		}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:42: error: expected ':' before ')' token
   16 |                         int cca=min(c?2,a);
      |                                          ^
      |                                          :
a.cc:16:42: error: expected primary-expression before ')' token
Language: C++

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

int main()
{
		int Q;
		cin>>Q;

		for(int i=0;i<Q;i++){
			int c,a,n;
			int can=min(min(c,a),n);
			c-=can;
			a-=can;
			
			int cca=min(c?2,a);
			c-=cca*2;
			int ccc=c/3;

			cout<<can+cca+ccc<<endl;
		}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:42: error: expected ':' before ')' token
   16 |                         int cca=min(c?2,a);
      |                                          ^
      |                                          :
a.cc:16:42: error: expected primary-expression before ')' token
Language: C++

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
using namespace std;

int main()
{
	int Q;
	int can[3];
	int total,temp;

	scanf("%d",&Q);
	for(int i = 0; i < Q; i++){
		total = INT_MAX;
		for(int j = 0; j < 3; j++){
			scanf("%d",&can[j]);
			if(total > can[j])
				total = can[j];
		}

		for(int j = 0; j< 3; j++)
			can[j] -= total;

		temp = min(can[0]/2,can[1]);
		total += temp;
		can[0] -= temp*2;
		can[1] -= temp;

		total += can[0]/3;

		printf("%d\n",total);
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: 'INT_MAX' was not declared in this scope
   15 |                 total = INT_MAX;
      |                         ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <functional>
  +++ |+#include <climits>
    5 | using namespace std;
Language: Java

va.util.Scanner;

public class Main {

	public static void main(String[] args) {

		new Main().run();
	}

	private void run() {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int R = scanner.nextInt();
		int L = scanner.nextInt();
		int[] P = new int[N];
		int[] T = new int[N];
		int PT = 0;
		int n1 = 0;
		for (int i = 0; i < R; i++) {
			int d = scanner.nextInt() - 1;
			int t = scanner.nextInt();
			int x = scanner.nextInt();
			P[d] += x;
			if (x > 0) {
				if (P[d] > P[n1] || (P[d] == P[n1] && n1 > d)) {
					T[n1] += t - PT + 1;
					PT = t;
					n1 = d;
				}
			}
			if (x < 0) {
				if (d != n1)
					continue;
				int n2 = n1, p2 = P[d];
				for (int j = N - 1; j >= 0; j--) {
					if (p2 <= P[j]) {
						n2 = j;
						p2 = P[j];
					}
				}
				if (n2 != n1) {
					T[n1] += t - PT + 1;
					PT = t;
					n1 = n2;
				}
			}
		}
		T[n1] += L - PT + 1;
		int ans_n = 0, ans_t = 0;
		for (int i = 0; i < N; i++) {
			if (ans_t < T[i]) {
				ans_t = T[i];
				ans_n = i;
			}
		}
		System.out.println(ans_n + 1);
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
va.util.Scanner;
^
1 error
Language: Java

import java.util.*;

public class mondai7 {
	public static void main(String[] args){
		int n, l, r, d, t = 0, x = 0, kiroku = 0, max =0, maxban = 0,max2 = 0, hensu = 0;
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		int[] ten = new int[n];
		int[] byou = new int[n];
		r = scan.nextInt();
		l = scan.nextInt();
		for(int i = 0; i < r; i++){
			d = scan.nextInt();
			t = scan.nextInt();
			x = scan.nextInt();
			if(i == 0){
				kiroku = t;
				byou[0] = t;
			}
			ten[d-1] = ten[d-1] + x;
			//maxbanのひとつまえを入力
			for(int j = 1; j < n; j++){
				if(max < ten[j]){
					max = ten[j];
					maxban = j;
				}
			}
			byou[maxban] = byou[maxban] + t - kiroku;
			kiroku = t;
			hensu = d;
		}
		byou[hensu - 1] = byou[hensu - 1] + (l - t);
		for(int k = 1; k < n; k++){
			if(byou[max2] < byou[k]){
				max2 = k;
			}
		}
		System.out.println(max2 + 1);
	}
}

Compiler output:
Main.java:3: error: class mondai7 is public, should be declared in a file named mondai7.java
public class mondai7 {
       ^
1 error
Language: Java

import java.util.*;

public class mondai7 {
	public static void main(String[] args){
		int n, l, r, d, p= 0, t = 0, x = 0, kiroku = 0, max =0, max2 = 0, hensu = 0;
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		int[] ten = new int[n];
		int[] byou = new int[n];
		r = scan.nextInt();
		int[] ban = new int[r];
		l = scan.nextInt();
		for(int i = 0; i < r; i++){
			d = scan.nextInt();
			t = scan.nextInt();
			x = scan.nextInt();
 			if(i == 0){
				kiroku = t;
				byou[0] = t;
			}
			ten[d-1] = ten[d-1] + x;
			//maxbanのひとつまえを入力
			for(int j = 1; j < n; j++){
				if(ten[max] < ten[j]){
					max = j;
				}
			}
			ban[p] = max;
			if(i > 0){
				byou[ban[p-1]] = byou[ban[p-1]] + t - kiroku;
			}
			kiroku = t;
			hensu = max;
			max = 0;
			p = p + 1;
		}
		byou[hensu] = byou[hensu] + (l - t);
		for(int k = 1; k < n; k++){
			if(byou[max2] < byou[k]){
				max2 = k;
			}
		}
		System.out.println(max2 + 1);
	}
}

Compiler output:
Main.java:3: error: class mondai7 is public, should be declared in a file named mondai7.java
public class mondai7 {
       ^
1 error
Language: C

#include <stdio.h>

int time[1000000];

int main(void)
{
	int n, r, l;
	int i;
	int before_time = 0;
	int longest = 0;
	
	scanf("%d %d %d", &n, &r, &l);
	for (i = 0; i < r; i++){
		int d, t, x;
		
		scanf("%d %d %d", &d, &t, &x);
		time[d - 1] += t - before_time;
		before_time = t;
	}
	time[d - 1] += 600 - t;
	for (i = 1; i < n; i++){
		if (time[longest] < time[i]){
			longest = i;
		}
	}
	printf("%d\n", longest + 1);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:14: error: 'd' undeclared (first use in this function)
   20 |         time[d - 1] += 600 - t;
      |              ^
main.c:20:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:30: error: 't' undeclared (first use in this function)
   20 |         time[d - 1] += 600 - t;
      |                              ^
Language: C

#include <stdio.h>

int time[1000000];

int main(void)
{
	int n, r, l;
	int i;
	int before_time = 0;
	int longest = 0;
	
	scanf("%d %d %d", &n, &r, &l);
	for (i = 0; i < r; i++){
		int d, t, x;
		
		scanf("%d %d %d", &d, &t, &x);
		time[d - 1] += t - before_time;
		before_time = t;
	}
	time[d - 1] += 600 - before_time;
	for (i = 1; i < n; i++){
		if (time[longest] < time[i]){
			longest = i;
		}
	}
	printf("%d\n", longest + 1);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:14: error: 'd' undeclared (first use in this function)
   20 |         time[d - 1] += 600 - before_time;
      |              ^
main.c:20:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <cstdio>
#include <algorithm>
using namespace std;

struct dat{ int id, point; };
#define SIZE 1 << 17

int N, R, L;
int res[MAX_N + 1];
dat seg[SIZE * 2 - 1];
int n;

void init(){
	n = 1;
	while(n < N) n *= 2;//nはseg木の要素数
	for(int i = 0; i < 2 * n - 1; i++) seg[i].point = 0;
	for(int j = 0; j <= N; j++){
		seg[n + j].id = j;
	}
}

void add(int p, int x){
	p += n;
	seg[p].point += x;
	while(p > 0){
		//printf("p = %d\n", p);
		p = (p - 1) / 2;
		if(seg[p * 2 + 1].point >= seg[p * 2 + 2].point){
			seg[p] = seg[p * 2 + 1];
		}
		else{
			seg[p] = seg[p * 2 + 2];
		}
	}
}

int main(){
	scanf("%d%d%d", &N, &R, &L);
	
	init();
	
	int lb = 0;//左端
	int d, t, x;
	for(int i = 0; i < R; i++){
		scanf("%d%d%d", &d, &t, &x);
		if(i > 0) res[seg[0].id] += t - lb;
		add(d, x);
		lb = t;
		//for(int i = 1; i <= N; i++){
		//	printf("%d ", res[i]);
		//}
		//printf(": seg[0].id = %d\n", seg[0].id);
	}
	res[seg[0].id] += L - t;
	
	int longest = 0;//最長の映り時間
	for(int i = 1; i <= N; i++) longest = max(longest, res[i]);
	for(int i = 1; i <= N; i++){
		if(res[i] == longest){
			printf("%d\n", i);
			return 0;
		}
	}
}

Compiler output:
a.cc:9:9: error: 'MAX_N' was not declared in this scope
    9 | int res[MAX_N + 1];
      |         ^~~~~
a.cc:6:16: warning: left shift count >= width of type [-Wshift-count-overflow]
    6 | #define SIZE 1 << 17
      |                ^
a.cc:10:9: note: in expansion of macro 'SIZE'
   10 | dat seg[SIZE * 2 - 1];
      |         ^~~~
a.cc: In function 'int main()':
a.cc:46:27: error: 'res' was not declared in this scope
   46 |                 if(i > 0) res[seg[0].id] += t - lb;
      |                           ^~~
a.cc:54:9: error: 'res' was not declared in this scope
   54 |         res[seg[0].id] += L - t;
      |         ^~~
Language: C++

#include <iostream>
#include <map>
#define INF (2 << 28)
using namespace std;

typedef pair<int, int> iiP;

int n;
iiP seg[2 * 100001 - 1];

void init(int q){

  n = 1;
  while(n < q) n *= 2;

  for(int i = 0; i < n; i++) seg[i] = iiP(-INF, -i);

}

void update(int i, iiP a){

  i += n - 1;
  seg[i] = a;

  while(i > 0){
    i = (i - 1) / 2;
    seg[i] = max(seg[i * 2 + 1], seg[i * 2 + 2]);
  }

}

int main(){

  int N, R, L, d, t, x, prev;
  int sumt[100001] = {0}, score[100001] = {0};
  cin >> N >> R >> L;

  init(N);
  cin >> d >> t >> x;
  sumt[1] += t, score[d] += x;
  update(d, iiP(score[d], -d));
  prev = t;
  //  cout << ":" << score[d] << " " << d << endl;
  for(int i = 1; i < R; i++){
    cin >> d >> t >> x;
    iiP p = seg[0];
    score[d] += x, sumt[-p.second] += t - prev;
    prev = t;
    //cout << ":" << score[d] << " " << d << endl;
    update(d, iiP(score[d], -d));
  }

  iiP p = seg[0];
  //  cout << p.first << " " << -p.second << endl;
  sumt[-p.second] += L - prev;

  cout << max_element(sumt + 1, sumt + N + 1) - sumt << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:11: error: 'max_element' was not declared in this scope
   57 |   cout << max_element(sumt + 1, sumt + N + 1) - sumt << endl;
      |           ^~~~~~~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <queue>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define MP make_pair
#define F first
#define S second

typedef pair<int, int> P;

int N, R, L;
int point[100005];
int res[100005];

int main(){
  scanf("%d%d%d", &N, &R, &L);
  int now = 0;
  memset(point, 0, sizeof(point));
  memset(res, 0, sizeof(res));

  priority_queue<P>q;
  rep(i, N) q.push(P(0, -i));
  rep(i, R){
    //    printf("%d\n", i);

    int d, t, x;
    scanf("%d%d%d", &d, &t, &x);d--;
    //    printf("%d %d %d\n", d, t, x);

    //    printf("%d\n", i);
    P p = q.top(); q.pop();
    while(p.F != point[-p.S]){
      p = q.top(); q.pop();
    }
    q.push(p);

    res[-p.S] += t - now;
    now = t;

    point[d] += x;
    //    printf("%d\n", d);
    //    rep(j, N) printf("%d ", point[j]); puts("");
    q.push(P(point[d], -d));
  }

  P p = q.top(); q.pop();
  while(p.F != point[-p.S]){
    //    printf("%d %d\n", p.F, point[-p.S]);
    p = q.top(); q.pop();
  }
  //  printf("%d %d\n", p.F, point[-p.S]);
  res[-p.S] += L - now;

  //  rep(i, N) printf("%d ", res[i]); puts("");
  int team = 0;
  rep(i, N) if(res[team] < res[i]) team = i;
  printf("%d\n", team+1);
  exit(0);
  return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:3: error: 'memset' was not declared in this scope
   23 |   memset(point, 0, sizeof(point));
      |   ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <algorithm>
  +++ |+#include <cstring>
    5 |
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define MP make_pair
#define F first
#define S second

typedef pair<int, int> P;

int N, R, L;
int point[100005];
int res[100005];

int main(){
  scanf("%d%d%d", &N, &R, &L);
  int now = 0;
  memset(point, 0, sizeof(point));
  memset(res, 0, sizeof(res));

  priority_queue<P>q;
  rep(i, N) q.push(P(0, -i));
  rep(i, R){
    //    printf("%d\n", i);

    int d, t, x;
    scanf("%d%d%d", &d, &t, &x);d--;
    //    printf("%d %d %d\n", d, t, x);

    //    printf("%d\n", i);
    P p = q.top(); q.pop();
    while(p.F != point[-p.S]){
      p = q.top(); q.pop();
    }
    q.push(p);

    res[-p.S] += t - now;
    now = t;

    point[d] += x;
    //    printf("%d\n", d);
    //    rep(j, N) printf("%d ", point[j]); puts("");
    q.push(P(point[d], -d));
  }

  P p = q.top(); q.pop();
  while(p.F != point[-p.S]){
    //    printf("%d %d\n", p.F, point[-p.S]);
    p = q.top(); q.pop();
  }
  //  printf("%d %d\n", p.F, point[-p.S]);
  res[-p.S] += L - now;

  //  rep(i, N) printf("%d ", res[i]); puts("");
  int team = 0;
  rep(i, N) if(res[team] < res[i]) team = i;
  printf("%d\n", team+1);
  exit(0);
  return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:3: error: 'memset' was not declared in this scope
   24 |   memset(point, 0, sizeof(point));
      |   ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <algorithm>
  +++ |+#include <cstring>
    6 |
Language: C++

n, r, l = map(int, input().split())
point, time = [], []
rev = {0: []}
for i in range(n):
    point.append(0)
    time.append(0)
    rev[0].append(i)

now, tv, tmax = 0, 0, 0
for i in range(r):
    d, t, x = map(int, input().split())
    time[tv] += t - now
    now = t
    m = point[d-1]
    rev[point[d-1]].remove(d-1)
    point[d-1] += x
    if point[d-1] in rev:
        rev[point[d-1]].append(d-1)
    else:
        rev[point[d-1]] = [d-1]
    if tv != d-1: 
        if point[tv] == point[d-1]:
            tv = min(tv, d-1)
        elif point[tv] < point[d-1]:
            tv = d-1
    elif x < 0:
        if rev[m] != []:
            tv = min(rev[m])
        else:
            tv = min(rev[max(point)])

time[tv] += l - now

m = max(time)
i = 0
while True:
    if time[i] == m:
        print(i+1)
        break
    i += 1

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, r, l = map(int, input().split())
      | ^
a.cc:4:1: error: expected unqualified-id before 'for'
    4 | for i in range(n):
      | ^~~
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <utility>
#include <algorithm>
#define REP(i,n) for(int i = 0; i < n; i++)
#define REP(j,n) for(int j = 0; j < n; j++)

using namespace std;
typedef pair<int, int> P;

int main() {
    int n,r,l;
    cin >> n;
    cin >> r;
    cin >> l;
    int list[n+1];
    int time[n+1];
    memset(list, 0, (n+1)*4);
    memset(time, 0, (n+1)*4);
    int top = 0;
    int id  = 1;
    int nowtime = 0;
    int timemax = 0;
    int timemaxid = 0;
    for(int i = 0; i < r; i++) {
        int d,t,x;
        cin >> d;
        cin >> t;
        cin >> x;
        time[id] += t - nowtime;
        if(time[id] > timemax) {
            timemax = time[id];
            timemaxid = id;
        }
        nowtime = t;
        list[d] += x;
        if(id == d) {
            top += x;
        }
        if(x < 0 && d == id) {
            for(int j = 1; j < n+1; j++) {
                if(top < list[j] || (top == list[j] && j < id)) {
                    top = list[j];
                    id = j;
                }
            }
            
        }
        if(x > 0 && d != id) {
            if(top < list[d] || (top == list[d] && d < id)) {
                top = list[d];
                id = d;
            }
        }

    }
    time[id] += l - nowtime;
    if(time[id] > timemax) {
        timemax = time[id];
        timemaxid = id;
    }
    cout << timemaxid << "\n";
}

Compiler output:
a.cc:12:9: warning: "REP" redefined
   12 | #define REP(j,n) for(int j = 0; j < n; j++)
      |         ^~~
a.cc:11:9: note: this is the location of the previous definition
   11 | #define REP(i,n) for(int i = 0; i < n; i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:24:5: error: 'memset' was not declared in this scope
   24 |     memset(list, 0, (n+1)*4);
      |     ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <algorithm>
  +++ |+#include <cstring>
   11 | #define REP(i,n) for(int i = 0; i < n; i++)
Language: C++

#include<iostream>
#include<cstring>
#include<map>
using namespace std;
#define MAX 1111111
#define MIN -1111111
typedef pair<int,int> P;
void init(int n);
void update(int k,int x);
P maxx(int k1,int k2);
P dat[2*100000];
int tim[100001]={0};
int N;

int main(){
  int R,L;
  cin >> N >> R >> L;
  int n_tmp = N;
  init(N);
  memset(tim,0,n_tmp+1);
  int now = 0;
  dat[0]=P(MIN,1);
  for(int i=0;i<R;i++){
    int d,t,x;
    cin >> d >> t >> x;
    tim[dat[0].second] += t - now;
    update(d,x);
    now = t;
  }
  tim[dat[0].second] += L - now;
  int *ans = max_element(tim,tim+n_tmp+1);
  cout << ans - tim << endl;
}

void init(int n){
  N=1;
  while(N<n) N*=2;
  for(int i=0;i<2*N-1;i++){
    dat[i]=P(MIN,MAX);
  }
  for(int i=N-1;i<N-1+n;i++){
    dat[i]=P(0,i-(N-2));
  }
  return;
}

void update(int k,int x){
  k += N - 2;
  //cout << k << " " << x << endl;
  P p = dat[k];
  int score = p.first;
  int team = p.second;
  cout << score << " " << team << endl;
  dat[k] = P(score+x,team);
  while(k > 0){
    k = (k - 1) / 2;
    dat[k] = maxx(k*2+1,k*2+2);
    //cout << dat[k].first << " " << dat[k].second << endl;
  }
  return;
}

P maxx(int k1,int k2){
  P p;
  if(dat[k1].first == dat[k2].first){
    p = P(dat[k1].first,min(dat[k1].second,dat[k2].second));
  }
  else {
    p = max(dat[k1],dat[k2]);
  }
  return p;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:14: error: 'max_element' was not declared in this scope
   31 |   int *ans = max_element(tim,tim+n_tmp+1);
      |              ^~~~~~~~~~~
Language: C++

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

pair<int,int> rmq[1111111111111];
int N,R,L;
int d[1111111]={0};
int t[1111111]={0};
int x[1111111]={0};
int team[11111111]={0};

void updata(int k,int x){
  int no=k;
  k += N-1;
  rmq[k].first += x;
  rmq[k].second = k;
  while(k > 0){
    k = (k - 1) / 2;
    if(rmq[k*2+1].first > rmq[k*2+2].first){
      rmq[k] = rmq[k*2+1];
    }
    else if(rmq[k*2+1].first < rmq[k*2+2].first){
      rmq[k] = rmq[k*2+2];
    }
    else if(rmq[k*2+1].second < rmq[k*2+2].second){
      rmq[k] = rmq[k*2+1];
    }
    else{
      rmq[k] = rmq[k*2+2];
    }
  }
  return;
}


int main(){
  for(int i=0;i<1111111;i++){
    rmq[i].first = 0;
    rmq[i].second = 0;
  }
  int smp=0;
  int now=0;
  int now1=0;
  cin >> N >> R >> L;
  for(int i=0;i<R;i++){
    smp = rmq[0].second;
    cin >> d[i] >> t[i] >> x[i];
    updata(d[i],x[i]);
    if(smp != rmq[0].second){
      team[smp-2] += t[i] - now;
      if(t[i] != t[i+1]){ 
	now = t[i];
      }
    }
    smp = rmq[0].second;
  }
  team[smp-2] += L - now;
  int a=0;
  int ans=0;
  for(int i=1;i<=N;i++){
    //cout<<team[i]<<endl;
    if(a < team[i]){
      ans = i;
      a = team[i];
    }
  }
  cout << ans << endl;
}

Compiler output:
/tmp/ccQjQPos.o: in function `updata(int, int)':
a.cc:(.text+0x16): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccQjQPos.o
/tmp/ccQjQPos.o: in function `main':
a.cc:(.text+0x2b6): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccQjQPos.o
a.cc:(.text+0x2d2): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccQjQPos.o
a.cc:(.text+0x2e7): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccQjQPos.o
a.cc:(.text+0x31b): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccQjQPos.o
a.cc:(.text+0x347): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccQjQPos.o
a.cc:(.text+0x36c): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccQjQPos.o
a.cc:(.text+0x38e): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccQjQPos.o
a.cc:(.text+0x3a5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccQjQPos.o
a.cc:(.text+0x3d7): relocation truncated to fit: R_X86_64_PC32 against symbol `team' defined in .bss section in /tmp/ccQjQPos.o
a.cc:(.text+0x3ee): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

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

pair<int,int> rmq[1111111111111];
int N,R,L;
int d[1111111]={0};
int t[1111111]={0};
int x[1111111]={0};
int team[11111111]={0};

void updata(int k,int x){
  int no=k;
  k += N-1;
  rmq[k].first += x;
  rmq[k].second = k;
  while(k > 0){
    k = (k - 1) / 2;
    if(rmq[k*2+1].first > rmq[k*2+2].first){
      rmq[k] = rmq[k*2+1];
    }
    else if(rmq[k*2+1].first < rmq[k*2+2].first){
      rmq[k] = rmq[k*2+2];
    }
    else if(rmq[k*2+1].second < rmq[k*2+2].second){
      rmq[k] = rmq[k*2+1];
    }
    else{
      rmq[k] = rmq[k*2+2];
    }
  }
  return;
}


int main(){
  for(int i=0;i<1111111;i++){
    rmq[i].first = 0;
    rmq[i].second = 0;
  }
  int smp=0;
  int now=0;
  int now1=0;
  cin >> N >> R >> L;
  for(int i=0;i<R;i++){
    smp = rmq[0].second;
    cin >> d[i] >> t[i] >> x[i];
    updata(d[i],x[i]);
    if(smp != rmq[0].second){
      team[smp-2] += t[i] - now;
      if(t[i] != t[i+1]){ 
	now = t[i];
      }
    }
    smp = rmq[0].second;
  }
  team[smp-2] += L - now;
  int a=0;
  int ans=0;
  for(int i=1;i<=N;i++){
    //cout<<team[i]<<endl;
    if(a < team[i]){
      ans = i;
      a = team[i];
    }
  }
  cout << ans << endl;
}

Compiler output:
/tmp/ccrgfrAU.o: in function `updata(int, int)':
a.cc:(.text+0x16): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccrgfrAU.o
/tmp/ccrgfrAU.o: in function `main':
a.cc:(.text+0x2b6): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccrgfrAU.o
a.cc:(.text+0x2d2): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccrgfrAU.o
a.cc:(.text+0x2e7): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccrgfrAU.o
a.cc:(.text+0x31b): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccrgfrAU.o
a.cc:(.text+0x347): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccrgfrAU.o
a.cc:(.text+0x36c): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccrgfrAU.o
a.cc:(.text+0x38e): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccrgfrAU.o
a.cc:(.text+0x3a5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccrgfrAU.o
a.cc:(.text+0x3d7): relocation truncated to fit: R_X86_64_PC32 against symbol `team' defined in .bss section in /tmp/ccrgfrAU.o
a.cc:(.text+0x3ee): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <queue>
#define rep(i,n) for(int i = 0; i < n; ++i)
#define rrep(i,n) for(int i = 1; i <= n; ++i)
using namespace std;
typedef pair<int,int> P;
const int INF = 1000000000;

int main(){
	/*
	int N,R,L;
	int n,t,s;
	int nowN=-1,befT=0,maxS;
	static int scr[114514],time[114514];
	scanf("%d%d%d",&N,&R,&L);
	rep(i,R){
		maxS=-INF;
		scanf("%d%d%d",&n,&t,&s);
		if(nowN>-1)time[nowN]+=t-befT;
		scr[n-1]+=s;
		rep(i,N)maxS=max(scr[i],maxS);
		rep(i,N)if(scr[i]==maxS){nowN=i;break;}
		befT=t;
	}
		maxS=-INF;
		t=L;
		time[nowN]+=t-befT;
		rep(i,N)maxS=max(time[i],maxS);
		rep(i,N)if(time[i]==maxS){nowN=i;break;}
		printf("%d\n",nowN+1);
	return 0;*/
	
	int N,R,L;
	int n,t,s;
	int nowN=-1,befT=0,maxS;
	static int scr[114514],time[114514];
	scanf("%d%d%d",&N,&R,&L);
	rep(i,R){
		maxS=-INF;
		scanf("%d%d%d",&n,&t,&s);
		if(nowN>-1)time[nowN]+=t-befT;
		scr[n-1]+=s;
		nowN = (scr[n-1]==scr[nowN]?min(n-1,nowN):scr[n-1]>scr[nowN]>n-1:nowN);
		befT=t;
	}
		maxS=-INF;
		t=L;
		time[nowN]+=t-befT;
		nowN = (time[n-1]==time[nowN]?min(n-1,nowN):time[n-1]>time[nowN]>n-1:nowN);
		printf("%d\n",nowN+1);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:81: error: expected ')' before ':' token
   46 |                 nowN = (scr[n-1]==scr[nowN]?min(n-1,nowN):scr[n-1]>scr[nowN]>n-1:nowN);
      |                        ~                                                        ^
      |                                                                                 )
a.cc:52:85: error: expected ')' before ':' token
   52 |                 nowN = (time[n-1]==time[nowN]?min(n-1,nowN):time[n-1]>time[nowN]>n-1:nowN);
      |                        ~                                                            ^
      |                                                                                     )
Language: C++

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

#define MAX_N 100000000
#define MAX_TEAM 10000000

priority_queue<pair<int, int>> Q;
int d[MAX_N], n, s, L, x[MAX_N], y[MAX_N], t[MAX_N], d[MAX_TEAM], ti[MAX_TEAM];

int main() {
	cin >> n >> s >> L;
	Q.push(make_pair(0, -1000000000));
	x[0] = 0; t[0] = 0; y[0] = 0; x[s + 1] = 0; t[s + 1] = L; y[s + 1] = 0;
	for (int i = 1; i <= s + 1; i++) {
		if (i <= s) { cin >> x[i] >> t[i] >> y[i]; }
		d[x[i]] += y[i];
		Q.push(make_pair(d[x[i]], -x[i]));
		while (true) {
			pair<int, int>p = Q.top();
			if (p.first == d[-p.second]) {
				ti[p.second] += x[i] - x[i - 1]; break;
			}
			Q.pop();
		}
	}
}

Compiler output:
a.cc:9:54: error: conflicting declaration 'int d [10000000]'
    9 | int d[MAX_N], n, s, L, x[MAX_N], y[MAX_N], t[MAX_N], d[MAX_TEAM], ti[MAX_TEAM];
      |                                                      ^
a.cc:9:5: note: previous declaration as 'int d [100000000]'
    9 | int d[MAX_N], n, s, L, x[MAX_N], y[MAX_N], t[MAX_N], d[MAX_TEAM], ti[MAX_TEAM];
      |     ^
Language: C++

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

#define MAX_N 10000000
#define MAX_TEAM 10000000

priority_queue<pair<int, int>> Q;
int d[MAX_N], n, s, L, x[MAX_N], y[MAX_N], t[MAX_N], d[MAX_TEAM], ti[MAX_TEAM];

int main() {
	cin >> n >> s >> L;
	Q.push(make_pair(0, -1000000000));
	x[0] = 0; t[0] = 0; y[0] = 0; x[s + 1] = 0; t[s + 1] = L; y[s + 1] = 0;
	for (int i = 1; i <= s + 1; i++) {
		if (i <= s) { cin >> x[i] >> t[i] >> y[i]; }
		d[x[i]] += y[i];
		Q.push(make_pair(d[x[i]], -x[i]));
		while (true) {
			pair<int, int>p = Q.top();
			if (p.first == d[-p.second]) {
				ti[p.second] += x[i] - x[i - 1]; break;
			}
			Q.pop();
		}
	}
}

Compiler output:
a.cc:9:54: error: redefinition of 'int d [10000000]'
    9 | int d[MAX_N], n, s, L, x[MAX_N], y[MAX_N], t[MAX_N], d[MAX_TEAM], ti[MAX_TEAM];
      |                                                      ^
a.cc:9:5: note: 'int d [10000000]' previously declared here
    9 | int d[MAX_N], n, s, L, x[MAX_N], y[MAX_N], t[MAX_N], d[MAX_TEAM], ti[MAX_TEAM];
      |     ^