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

#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 1000000;
int Time[MAX];
int Team[MAX];
int takai[MAX];
int takai_n[MAX];
int Team_max[MAX];
int main(){
	int N,R,L;
	int d,t,x;
	int temp,temp1=0,flag = 0;
	cin >> N >> R >> L;
	memset(takai,0,sizeof(takai+N)+1);
	memset(takai_n,0,sizeof(takai_n+N)+1);
	memset(takai,0,sizeof(takai+N)+1);
	for(int i=1;i<=N;i++){
		takai_n[i] = i;
	}
	for(int h=0;h<R;h++){
		cin >> d >> t >> x;
		for(int i=1;i<=N;i++){
			if(d == takai_n[i] ) takai[i] += x;
		}
		for(int i=1;i<N;i++){
			for(int j=i+1;j<N+1;j++){
				if(takai[i] < takai[j]){
					swap(takai[i],takai[j]);
					swap(takai_n[i],takai_n[j]);
				}
			}
		}
		Time[t] = takai[1];
		Team[t] = takai_n[1];
	}
	int n= 0;
	for(int i=0;i<=L;i++){
		if(Time[i] > 0 && flag == 0) {
			temp = i;
			temp1 = Team[i];
			flag= 1;
		}
		else if(Time[i] > 0 && flag == 1){
			Team_max[temp1] += i - temp;
			cout << Team_max[temp1] << endl; 
			temp = i;
			temp1 = Team[i];
		}
		if(Time[i] > 0) n =i;
		if(i == L)Team_max[temp1] += L-n;
	}
	int a = 0;int te = 0;
	for(int i=0;i<=N;i++){
		if(a < Team_max[i]){
			a = Team_max[i];
			te = i;
		}
	}
	cout << te << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'memset' was not declared in this scope
   15 |         memset(takai,0,sizeof(takai+N)+1);
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include "MDebug.h"
#include <iostream>
#include <queue>
#include <cstring>
#include <algorithm>
#include <conio.h>
using namespace std;

static const int MAX_N = 1000001;

int T_Time[MAX_N], Score[MAX_N];

int main()
{

	int N, R, L, d, t, x, most, P_T = 0, P_D = 1;
	priority_queue< pair< int, int > > ScoreHeap;

	memset( Score , 0, sizeof( Score ) );
	memset( T_Time, 0, sizeof( T_Time ) );

	cin >> N >> R >> L;

	for( int i = 0; i < R; i++ ) {

		cin >> d >> t >> x;
		Score[d] += x;

		ScoreHeap.push( make_pair( Score[d], -d ) );

		while( true ) {

			pair< int, int > temp = ScoreHeap.top();
			if( temp.first == Score[-temp.second] ) {

				T_Time[P_D] += t - P_T;
				P_D = -temp.second;
				P_T = t;
				break;

			}

			ScoreHeap.pop();

		}

	}

	T_Time[P_D] += L - P_T;

	for( int i = 1; i <= N - 1; i++ ) {

		if( T_Time[i] == T_Time[i + 1] ) most = i;
		else if( T_Time[i] < T_Time[i + 1] ) most = i + 1;
		else most = i;

	}

	cout << most << endl;

	return 0;

}

Compiler output:
a.cc:1:10: fatal error: MDebug.h: No such file or directory
    1 | #include "MDebug.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<stdio.h>
int main(){
	int a,toread,N,R,L,d,t,x,i,time=0,team,T[1001],P[1001],i2,max,dscanf[1001],tscanf[1001],xscanf[1001];
	scanf("%d%d%d",&N,&R,&L);
	for(i=0;i<=R;i++){
		T[i]=0;
		P[i]=0;
	}
	for(i=1;i<=R;i++){
		scanf("%d%d%d",&d,&t,&x);
		dscanf[i]=d;
		tscanf[i]=t;
		xscanf[i]=x;
	}
	for(i=1;i<=R;i++){
		if(i!=1){
			for(a=i;a>=1;a--){
				if(tscanf[i]>=tscanf[a]){
					toread=tscanf[i];
					tscanf[i]=tscanf[a];
					tscanf[a]=toread;
					toread=dscanf[i];
					dscanf[i]=dscanf[a];
					dscanf[a]=toread;
					toread=xscanf[i];
					xscanf[i]=xscanf[a];
					xscanf[a]=toread;
				}
			}
		}
	}
	for(i=1;i<=R;i++){
		d=dscanf[i];
		t=tscanf[i];
		x=xscanf[i];
		P[d]+=x;
		max=0;
		if(i!=1){
			for(i2=1;i2<=R;i2++){
				if(P[i2]>P[max]){
					max=i2;
				}
				else if(P[i2]==P[max]&&i2<max){
					max=i2;
				}
			}
		T[team]+=t-time;
		}
		time=t;
		team=max;
		T[0]=0;
	}
	if(time!=L){
		T[max]=L-time;
	}
	for(i=1;i<=R;i++){
		if(T[i]>T[max]){
			max=i;
		}
		else if(T[i]==T[max]&&i<max){
			max=i;
		}
	}
	printf("%d\n",max);
	return 0;
}#include<stdio.h>
int main(){
	int a,toread,N,R,L,d,t,x,i,time=0,team,T[1001],P[1001],i2,max,dscanf[1001],tscanf[1001],xscanf[1001];
	scanf("%d%d%d",&N,&R,&L);
	for(i=0;i<=R;i++){
		T[i]=0;
		P[i]=0;
	}
	for(i=1;i<=R;i++){
		scanf("%d%d%d",&d,&t,&x);
		dscanf[i]=d;
		tscanf[i]=t;
		xscanf[i]=x;
	}
	for(i=1;i<=R;i++){
		if(i!=1){
			for(a=i;a>=1;a--){
				if(tscanf[i]>=tscanf[a]){
					toread=tscanf[i];
					tscanf[i]=tscanf[a];
					tscanf[a]=toread;
					toread=dscanf[i];
					dscanf[i]=dscanf[a];
					dscanf[a]=toread;
					toread=xscanf[i];
					xscanf[i]=xscanf[a];
					xscanf[a]=toread;
				}
			}
		}
	}
	for(i=1;i<=R;i++){
		d=dscanf[i];
		t=tscanf[i];
		x=xscanf[i];
		P[d]+=x;
		max=0;
		if(i!=1){
			for(i2=1;i2<=R;i2++){
				if(P[i2]>P[max]){
					max=i2;
				}
				else if(P[i2]==P[max]&&i2<max){
					max=i2;
				}
			}
		T[team]+=t-time;
		}
		time=t;
		team=max;
		T[0]=0;
	}
	if(time!=L){
		T[max]=L-time;
	}
	for(i=1;i<=R;i++){
		if(T[i]>T[max]){
			max=i;
		}
		else if(T[i]==T[max]&&i<max){
			max=i;
		}
	}
	printf("%d\n",max);
	return 0;
}

Compiler output:
a.cc:66:2: error: stray '#' in program
   66 | }#include<stdio.h>
      |  ^
a.cc:66:3: error: 'include' does not name a type
   66 | }#include<stdio.h>
      |   ^~~~~~~
Language: C++

#include<bits/stdc++.h>
#define int long long
#define P pair<int,int>
#define INF LLONG_MAX/3
using namespace std;

P segment[500000];
int point[100000];
signed main(){
    int a,b,c;
    cin>>a>>b>>c;
    int d=1;
    while(d<a)d*=2;
    for(int e=0;e<d;e++){
	if(e<a)segment[d-1+e]=P(0,e);
	else segment[d-1-e]=P(INF,INF);
	}
    d--;	
    for(int e=0;e<d;e++){
	segment[e]=min(segment[e*2+1],segment[e*2+2]);
	}
    int last=0,team=0;
    for(int i=0;i<b;i++){
	int x,y,z;sacnf("%lld%lld%lld",&x,&y,&z);
	x--;
	int S=d+x;
	segment[S].first-=z;
	while(S>0){
	    S/=2;
	    segment[S]=min(segment[S*2+1],segment[S*2+2]);
	    }
	point[team]+=y-last;
	team=segment[0].second;
	last=y;
	}
    point[team]+=c-last;
    int n=-(INF),m=0;	
    for(int i=0;i<a;i++){if(point[i]>n){n=point[i];m=i+1;}}
    cout<<m<<endl;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: 'sacnf' was not declared in this scope; did you mean 'scanf'?
   24 |         int x,y,z;sacnf("%lld%lld%lld",&x,&y,&z);
      |                   ^~~~~
      |                   scanf
Language: C++

#include <iostream>
#include <algorithm>
#include <cstring>
#include <map>

using namespace std;

const int MAX_N = 1 << 17;

typedef pair<int, int> P;

int n, cnt[MAX_N];
P dat[2*MAX_N-1];

void init(int n_){
  n = 1;
  while(n < n_) n *= 2;
  for(int i=0;i<2*n-1;i++) dat[i] = make_pair(INT_MAX, INT_MAX);
}

void update(int k, P a){
  k += n - 1;
  dat[k] = a;
  while(k > 0){
    k = (k - 1) / 2;
    dat[k] = min(dat[k*2+1], dat[k*2+2]);
  }
}

//min [a, b)
//call query(a, b, 0, 0, n)
P query(int a, int b, int k, int l, int r){
  if(r <= a || b <= l) return make_pair(INT_MAX, INT_MAX);
  if(a <= l && r <= b) return dat[k];
  else{
    P vl = query(a, b, k*2+1, l, (l+r)/2);
    P vr = query(a, b, k*2+2, (l+r)/2, r);
    return min(vl, vr);
  }
}

int main(){
	int N, R, L;
	cin >> N >> R >> L;
	memset(cnt, 0, sizeof(cnt));
	init(N);
	for(int i=0;i<N;i++) update(i, make_pair(0, i));
	int T = 0;
	for(int i=0;i<R;i++){
		int d, t, x;
		cin >> d >> t >> x;
		d--;
		if(T != t){
			P tmp = query(0, N, 0, 0, n);
			cnt[tmp.second] += t - T;
		}
		P tmp = query(d, d + 1, 0, 0, n);
		update(d, make_pair(tmp.first - x, tmp.second));
		T = t;
	}
	if(T != L){
		P tmp = query(0, N, 0, 0, n);
		cnt[tmp.second] += L - T;
	}
	int valM = -1, id;
	for(int i=0;i<N;i++){
		if(valM < cnt[i]){
			valM = cnt[i];
			id = i;
		}
	}
	cout << id + 1 << endl;
}

Compiler output:
a.cc: In function 'void init(int)':
a.cc:18:47: error: 'INT_MAX' was not declared in this scope
   18 |   for(int i=0;i<2*n-1;i++) dat[i] = make_pair(INT_MAX, INT_MAX);
      |                                               ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <map>
  +++ |+#include <climits>
    5 | 
a.cc: In function 'P query(int, int, int, int, int)':
a.cc:33:41: error: 'INT_MAX' was not declared in this scope
   33 |   if(r <= a || b <= l) return make_pair(INT_MAX, INT_MAX);
      |                                         ^~~~~~~
a.cc:33:41: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include<iostream>
using namespace std;
int top_id(int *x,int N){
  int top=x[1];
  int id=1;
  for(int i=2;i<=N;i++){
    if(top<x[i]){
      top = x[i];
      id = i;
    }
  }
  return id;
}
int main(){
  int N,R,L;
  cin >> N >> R >> L;
  int top=1;
  int d,t[2],x;
  int tim[N+1];
  int total[N+1];
  t[0] = 0;
  for(int i=0;i<N;i++){
    tim[i] = 0;
    total[i] = 0;
  }
  for(int i=0;i<R;i++){
    cin >> d >> t[1] >> x;
    total[d] += x;
    tim[top] += (t[1] - t[0]);
    top = top_id(total,N);
    t[0] = t[1];
  }
  tim[top] += (L - t[0]);
  int top_t=0;
  int ans;
  for(int i=1;i<=N;i++){
    if(top_t<x[i]){
      top_t = x[i];
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:15: error: invalid types 'int[int]' for array subscript
   37 |     if(top_t<x[i]){
      |               ^
a.cc:38:16: error: invalid types 'int[int]' for array subscript
   38 |       top_t = x[i];
      |                ^
Language: C++

#include<iostream>
using namespace std;
int top_id(int *x,int N){
  int top=x[1];
  int id=1;
  for(int i=2;i<=N;i++){
    if(top<x[i]){
      top = x[i];
      id = i;
    }
  }
  return id;
}
int main(){
  int N,R,L;
  cin >> N >> R >> L;
  int top=1;
  int d,t,x;
  int oldt=0;
  int tim[N+1];
  int total[N+1];
  t[0] = 0;
  for(int i=0;i<=N;i++){
    tim[i] = 0;
    total[i] = 0;
  }
  for(int i=0;i<R;i++){
    cin >> d >> t >> x;
    tim[top] += (t - oldt);
    oldt = t;
    total[d] += x;
    top = top_id(total,N)
  }
  tim[top] += (L - t[0]);
  int top_t=0;
  int ans;
  for(int i=1;i<=N;i++){
    if(top_t<tim[i]){
      top_t = tim[i];
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:4: error: invalid types 'int[int]' for array subscript
   22 |   t[0] = 0;
      |    ^
a.cc:32:26: error: expected ';' before '}' token
   32 |     top = top_id(total,N)
      |                          ^
      |                          ;
   33 |   }
      |   ~                       
a.cc:34:21: error: invalid types 'int[int]' for array subscript
   34 |   tim[top] += (L - t[0]);
      |                     ^
Language: C++

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

int main(){
	typedef pair<int,int> pii;
	priority_queue<pii> pq;
	int n, r, l, d, t, x, u = 0;
	scanf("%d%d%d", &n, &r, &l);
	vector<int> s(n + 1), c(n + 1);
	for(int i = 1; i <= n; ++i){
		pq.push(pii(0, ~i));
	}
	for(int i = 0; ; ++i){
		if(i == r){
			t = l;
		}
		else{
			scanf("%d%d%d", &d, &t, &x);
		}
		while(1){
			pii &p = pq.top();
			if(s[~p.second] == p.first){
				c[~p.second] += t - u;
				break;
			}
			pq.pop();
		}
		if(i == r){
			break;
		}
		s[d] += x;
		pq.push(pii(s[d], ~d));
		u = t;
	}
	int ans = max_element(c.begin(), c.end()) - c.begin();
	printf("%d\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:40: error: binding reference of type 'pii&' {aka 'std::pair<int, int>&'} to 'const __gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'const std::pair<int, int>'} discards qualifiers
   24 |                         pii &p = pq.top();
      |                                  ~~~~~~^~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <queue>

using namespace std;

typedef long long LL;
typedef pair<LL, int> P;
const LL INF = LONG_MAX / 2LL;

const int MAX_N = 262144;
P dat[MAX_N * 2 - 1];
LL times[MAX_N];

int n, r, l;

void init()
{
	for (int i = 0; i < 2 * n - 1; i++)
	{
		dat[i] = P(0, -(2 << 20));
	}
	for (int i = 0; i < n; i++)
	{
		dat[n + i - 1].second = -i;
	}
}

void update(int i, LL x)
{
	i += n - 1;
	dat[i].first += x;
	while (i > 0)
	{
		i = (i - 1) / 2;
		dat[i] = max(dat[i * 2 + 1], dat[i * 2 + 2]);
	}
}

P query(int a, int b, int k, int l, int r)
{
	if(r <= a || b <= l) return P(-INF, -1);
	if(a <= l && r <= b) return dat[k];
	else
	{
		P vl = query(a, b,k * 2 + 1, l, (l + r) / 2);
		P vr = query(a, b,k * 2 + 1, (l + r) / 2, r);
		if(vr > vl) return vr;
		return vl;
	}
}

int main(void)
{
	while(cin >> n >> r >> l && n >= 2)
	{
		vector<int> d(r), x(r), t(r);
		for (int i = 0; i < r; i++)
		{
			cin >> d[i] >> x[i] >> t[i];
			d[i]--;
		}
		init();
		memset(times, 0, sizeof(times));
		P pre = P(0,0);
		int pret = 0;
		for (int i = 0; i < r; i++)
		{
			if(i + 1 < r && t[i] == t[i + 1])
			{
				i++;
				update(d[i], x[i]);
				continue;
			}
			update(d[i], x[i]);
			P p = query(0, n-1, 0, 0, n);
			times[-pre.second] += (t[i] - pret);
			pret = t[i];
			pre = p;
		}
		cout << (max_element(times, times + n) - times) + 1 << endl;
	}
	return 0;
}

Compiler output:
a.cc:17:16: error: 'LONG_MAX' was not declared in this scope
   17 | const LL INF = LONG_MAX / 2LL;
      |                ^~~~~~~~
a.cc:12:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   11 | #include <queue>
  +++ |+#include <climits>
   12 |
Language: C++

#include <cstdio>
int P[100000],T[100000];
int main() {
    int N,R,L,PT=0,n1=0;
    scanf("%d %d %d",&N,&R,&L);
    for(int i=0;i<R;i++) {
        int d,t,x;
        scanf("%d %d %d",&d,&t,&x); d--;
        P[d]+=x;
        if(x>0) {
            if(P[d]>p1||(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;
        }
    }
    printf("%d\n",ans_n+1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'p1' was not declared in this scope; did you mean 'n1'?
   11 |             if(P[d]>p1||(P[d]==P[n1]&&n1>d)) {
      |                     ^~
      |                     n1
Language: C++

#include<iostream>
#include<math.h>
using namespace std ;

int num[2][262144] = {} ; // 0 point , 1 num
int ranking[100001] = {} ;
int n , r , l ;
int d , t , x ;
int minus = -1001 ;
int btd , bt , sum1=-1 , sum2=0 ;

void count( int p ){
	
	if( num[0][p*2] >= num[0][p*2+1] ){
		num[0][p] = num[0][p*2] ;
		num[1][p] = num[1][p*2] ;
	}else {
		num[0][p] = num[0][p*2+1] ;
		num[1][p] = num[1][p*2+1] ;
	}
	
	if( p!=1 ) count( p/2 ) ;
}

int main(){
	
	cin >> n >> r >> l ;
	
	for( int i=1 ; i<=n ; i++ ){
		num[1][i+131071] = i ;
	}
	
	for( int i=0 ; i<r ; i++ ){
		cin >> d >> t >> x ;
		if( i==0 ) ranking[1] = t ;
		num[0][d+131071] += x ;
		
		if( minus < t ) minus = t ;
		if( minus < 0 && t < 0 ){
			count( 131072 / 2 ) ;
		}else count( ( d+131071 ) / 2 ) ;
		
		if( i != 0 ) ranking[btd] = t-bt ;
		bt = t ;
		btd = num[1][1] ;
	}
	
	ranking[btd] = l-bt ;
	
	for( int i=1 ; i<=n ; i++ ){
		if( sum1 < ranking[i] ){
			sum1 = ranking[i] ;
			sum2 = i ;
		}
	}
	cout << sum2 << endl ;
	
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:21: error: reference to 'minus' is ambiguous
   38 |                 if( minus < t ) minus = t ;
      |                     ^~~~~
In file included from /usr/include/c++/14/string:49,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_function.h:163:12: note: candidates are: 'template<class _Tp> struct std::minus'
  163 |     struct minus;
      |            ^~~~~
a.cc:9:5: note:                 'int minus'
    9 | int minus = -1001 ;
      |     ^~~~~
a.cc:38:33: error: reference to 'minus' is ambiguous
   38 |                 if( minus < t ) minus = t ;
      |                                 ^~~~~
/usr/include/c++/14/bits/stl_function.h:163:12: note: candidates are: 'template<class _Tp> struct std::minus'
  163 |     struct minus;
      |            ^~~~~
a.cc:9:5: note:                 'int minus'
    9 | int minus = -1001 ;
      |     ^~~~~
a.cc:39:21: error: reference to 'minus' is ambiguous
   39 |                 if( minus < 0 && t < 0 ){
      |                     ^~~~~
/usr/include/c++/14/bits/stl_function.h:163:12: note: candidates are: 'template<class _Tp> struct std::minus'
  163 |     struct minus;
      |            ^~~~~
a.cc:9:5: note:                 'int minus'
    9 | int minus = -1001 ;
      |     ^~~~~
Language: C++

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

#define MAX_N 1000000

int N;
int input[MAX_N + 1], s[MAX_N + 1];
vector<int> score;

bool C(int r, int x){
	int inc = 0;
	vector<int>::iterator it = score.begin();
	for(int i = 1; i <= N; i++){
		//p = 0;
		while(it != score.end()){
			if(*it < s[i]) it++;
			else{
				if(*it - s[i] <= r){
					inc++;
					break;
				}
				else break;
			}
		}
	}
	return N - inc <= x;
}

int main(){
	int Q, a;
	bool change;
	char str[10];
	
	scanf("%d%d", &N, &Q);
	for(int i = 1; i <= N; i++){
		scanf("%d", &input[i]);
		s[i] = input[i];
	}
	sort(s + 1, s + N + 1);
	
	for(int i = 0; i < Q; i++){
		scanf("%s%d", str, &a);
		if(strcmp(str, "ADD") == 0){
			score.push_back(input[a]);
		}
		else if(strcmp(str, "REMOVE") == 0){
			vector<int>::iterator it = score.begin();
			for(; *it != input[a] && it != score.end(); it++);
			score.erase(it);
		}
		else if(strcmp(str, "CHECK") == 0){
			if(a == N){
				printf("0\n");
				continue;
			}
			if(score.empty()){
				printf("NA\n");
				continue;
			}
			sort(score.begin(), score.end());
			/*
			rの値を大きくしていくほど仲間はずれになる生徒の人数は
			少なくなっていくので、二分探索が適用できる
			*/
			int lb = -1, rb = score[score.size() - 1];
			change = false;
			while(rb - lb > 1){
				int mid = (lb + rb + 1) / 2;
				if(C(mid, a)){
					change = true;
					rb = mid;
				}
				else lb = mid;
			}
			
			if(change) printf("%ld\n", rb);
			else printf("NA\n");
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:20: error: 'strcmp' was not declared in this scope
   46 |                 if(strcmp(str, "ADD") == 0){
      |                    ^~~~~~
a.cc:5:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <vector>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

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

#define MAX_N 1000000

int N;
int input[MAX_N + 1], s[MAX_N + 1];
vector<int> score;

bool C(int r, int x){
	int inc = 0;
	vector<int>::iterator it = score.begin();
	for(int i = 1; i <= N; i++){
		//p = 0;
		while(it != score.end()){
			if(*it < s[i]) it++;
			else{
				if(*it - s[i] <= r){
					inc++;
					break;
				}
				else break;
			}
		}
	}
	return N - inc <= x;
}

int main(){
	int Q, a;
	bool change;
	char str[10];
	
	scanf("%d%d", &N, &Q);
	for(int i = 1; i <= N; i++){
		scanf("%d", &input[i]);
		s[i] = input[i];
	}
	sort(s + 1, s + N + 1);
	
	for(int i = 0; i < Q; i++){
		scanf("%s%d", str, &a);
		if(strcmp(str, "ADD") == 0){
			score.push_back(input[a]);
		}
		else if(strcmp(str, "REMOVE") == 0){
			vector<int>::iterator it = score.begin();
			for(; *it != input[a] && it != score.end(); it++);
			score.erase(it);
		}
		else if(strcmp(str, "CHECK") == 0){
			if(a == N){
				printf("0\n");
				continue;
			}
			if(score.empty()){
				printf("NA\n");
				continue;
			}
			sort(score.begin(), score.end());
			/*
			rの値を大きくしていくほど仲間はずれになる生徒の人数は
			少なくなっていくので、二分探索が適用できる
			*/
			int lb = -1, rb = score[score.size() - 1];
			change = false;
			while(rb - lb > 1){
				int mid = (lb + rb + 1) / 2;
				if(C(mid, a)){
					change = true;
					rb = mid;
				}
				else lb = mid;
			}
			
			if(change) printf("%d\n", rb);
			else printf("NA\n");
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:20: error: 'strcmp' was not declared in this scope
   46 |                 if(strcmp(str, "ADD") == 0){
      |                    ^~~~~~
a.cc:5:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <vector>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

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

#define for_(i,a,b) for(int i=a;i<b;++i)
#define allof(a) a.begin(),a.end()

typedef pair< int, int > pii;

int N, Q;
vector< int > s, id;
set< int > reader;

int count(int r) {
	if ((int)read.size() == 0) return N;
	
	set< int >::iterator it = reader.end();
	int res = 0, cur = N;
	
	do {
		--it;
		int its = *it;	
		if (its < cur) res += cur - its - 1;
		cur = lower_bound(allof(s), s[its] - r) - s.begin();
	} while (it != read.begin());
	
	res += cur;	
	return res;
}

int check(int x) {
	int lb = 0, ub = (int)1e9 + 10;
	
	while (ub - lb > 1) {
		int med = (lb + ub) / 2;		
		if (x < count(med)) lb = med;
		else ub = med;
	}
	
	if (count(lb) <= x) return lb;
	return ub;
}

void query() {
	for_(i,0,Q) {
		string t; int a; cin >> t >> a;
		
		if (t == "ADD") reader.insert(id[a-1]);	
		
		if (t == "REMOVE") reader.erase(id[a-1]);
		
		if (t == "CHECK") {
			int res = check(a);
			if (res > (int)1e9) cout << "NA" << endl;
			else cout << res << endl;
		} 
	}
}

int main() {
	cin >> N >> Q;
	
	vector< pii > vp;
	for_(i,0,N) {
		int s; cin >> s;
		vp.push_back(pii(s, i));
	}
	
	sort(allof(vp));
	
	s.assign(N, 0);
	id.assign(N, 0);
		
	for_(i,0,N) {
		s[i] = vp[i].first;
		id[vp[i].second] = i;
	}
	
	query();
	
	return 0;
}

Compiler output:
a.cc: In function 'int count(int)':
a.cc:14:23: error: request for member 'size' in 'read', which is of non-class type 'ssize_t(int, void*, size_t)' {aka 'long int(int, void*, long unsigned int)'}
   14 |         if ((int)read.size() == 0) return N;
      |                       ^~~~
a.cc:24:29: error: request for member 'begin' in 'read', which is of non-class type 'ssize_t(int, void*, size_t)' {aka 'long int(int, void*, long unsigned int)'}
   24 |         } while (it != read.begin());
      |                             ^~~~~
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int s[1000000];
int student[1000000];
int N;
vector<int> L;
bool check(int x,int r) {
	int start=0;
	int sum=0;
	for(int i=0;i<L.size();i++) {
		int pos=max(lower_bound(s,s+N,L[i]-r)-s,start);
		int k=upper_bound(s,s+N,L[i])-s;
		sum+=(k-pos);
		start=k;
	}
	return (N-sum)<=x;
}
int main() {
	int Q;
	scanf("%d %d",&N,&Q);
	for(int i=0;i<N;i++) {
		scanf("%d",&s[i]);
		student[i]=s[i];
	}
	sort(s,s+N);
	for(int i=0;i<Q;i++) {
		char query[10];
		int a;
		scanf("%s %d",query,&a);
		if(query[0]=='A') {
			a--;
			L.insert(lower_bound(L.begin(),L.end(),student[a]),student[a]);
		}else if(query[0]=='R') {
			a--;
			L.erase(lower_bound(L.begin(),L.end(),student[a]));
		}else {
			int l=-1,r=1<<29;
			while(r-l>1) {
				int m=(l+r)/2;
				if(check(a,m)) {
					r=m;
				}else {
					l=m;
				}
			}
			if(check(a,r)) {
				printf("%d\n",r);
			}else {
				printf("NA\n");
			}
		}
	}
}

Compiler output:
a.cc: In function 'bool check(int, int)':
a.cc:13:28: error: no matching function for call to 'max(long int, int&)'
   13 |                 int pos=max(lower_bound(s,s+N,L[i]-r)-s,start);
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:62,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:13:28: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   13 |                 int pos=max(lower_bound(s,s+N,L[i]-r)-s,start);
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:13:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   13 |                 int pos=max(lower_bound(s,s+N,L[i]-r)-s,start);
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <cmath>
#include <cstdio>
#include <vector>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

const double EPS=1e-8;
const double INF=1e77;

struct point{
	double x,y;
	point():x(0),y(0){}
	point(double x,double y):x(x),y(y){}
	point operator-(const point &a)const{ return point(x-a.x,y-a.y); }
	bool operator==(const point &a)const{ return abs(x-a.x)<EPS && abs(y-a.y)<EPS; }
};

double cross(const point &a,const point &b){ return a.x*b.y-a.y*b.x; }

typedef vector<point> polygon;

enum{CCW=1,CW=-1,ON=0};
int ccw(const point &a,const point &b,const point &c){
	double rdir=cross(b-a,c-a);
	if(rdir> EPS) return CCW;
	if(rdir<-EPS) return CW;
	return ON;
}

double area(const polygon &F){
	int n=F.size();
	double a=0;
	rep(i,n) a+=cross(F[i],F[(i+1)%n]);
	return abs(a)/2;
}

int n;
point P[40];

int K;
double ans;
point Q[40],Q_ans[40];
bool vis[40];

void dfs(int i){
	if(i==K){
		double res=area(polygon(Q,Q+K));
		if(res<ans){
			ans=res;
			memcpy(Q_ans,Q,sizeof Q);
		}
		return;
	}

	double res=INF;
	rep(j,n) if(!vis[j]) {
		Q[i]=P[j];
		if(ccw(Q[i-2],Q[i-1],Q[ i ])==CCW
		&& ccw(Q[i-1],Q[ i ],Q[ 0 ])==CCW
		&& ccw(Q[ i ],Q[ 0 ],Q[ 1 ])==CCW){
			vis[j]=true;
			dfs(i+1);
			vis[j]=false;
		}
	}
}

int main(){
	scanf("%d",&n);
	rep(i,n) scanf("%lf%lf",&P[i].x,&P[i].y);

	int q; scanf("%d",&q);
	rep(_,q){
		scanf("%d",&K);

		ans=INF;
		rep(i,n) rep(j,n) if(i!=j) {
			Q[0]=P[i];
			Q[1]=P[j];
			rep(k,n) vis[k]=false;
			vis[i]=vis[j]=true;
			dfs(2);
		}

		if(ans<INF/2){
			int i0=0;
			vector<int> seq(K);
			rep(i,K){
				seq[i]=find(P,P+n,Q_ans[i])-P;
				if(make_pair(Q_ans[i].y,Q_ans[i].x)<make_pair(Q_ans[i0].y,Q_ans[i0].x)) i0=i;
			}
			rep(i,i0){
				seq.push_back(seq[0]);
				seq.erase(seq.begin());
			}
			rep(i,K) printf("%d%c",seq[i]+1,i<K-1?' ':'\n');
		}
		else puts("NA");
	}

	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:52:25: error: 'memcpy' was not declared in this scope
   52 |                         memcpy(Q_ans,Q,sizeof Q);
      |                         ^~~~~~
a.cc:4:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <vector>
  +++ |+#include <cstring>
    4 | 
a.cc: In function 'int main()':
a.cc:91:40: error: 'find' was not declared in this scope
   91 |                                 seq[i]=find(P,P+n,Q_ans[i])-P;
      |                                        ^~~~
Language: C++

#include <cstdio>
#include <vector>
#include <cstring>
#include <cmath>
#include <algorithm>
#define INF 1e8
using namespace std;
typedef long long ll;
struct P{
	ll x,y,id;
	double dir;
	P(){}
	P(ll xx,ll yy,ll pp){
		x=xx;
		y=yy;
		id=pp;
		dir=atan2((double)yy,(double)xx);
		if(dir<0)dir=M_PI*2.0+dir;
	}
	P operator -(P p2){
		return P(x-p2.x,y-p2.y,id);
	}
	bool operator<(const P& p1)const{
		if(dir==p1.dir)return x<p1.x;
		return dir<p1.dir;
	}
};
P p[41];
bool used[41];
P pp[41];
ll n,q;
//dp[????????°][????§?][??????]
ll dp[41][41][41];
ll poll[41][41][41][41];
ll res[41];
ll respoll[41][41];

ll main(void){
	scanf("%d",&n);
	for(ll i=0;i<n;i++){
		ll x,y;
		scanf("%lld %lld",&x,&y);
		p[i]=P(x,y,i+1);
		res[i+1]=INF;
	}
	for(ll turn=0;turn<n-2;turn++){
		ll nec=-1;
		for(ll i=0;i<n;i++){
			if(used[i])continue;
			if(nec==-1)nec=i;
			else if(p[i].y<p[nec].y || (p[i].y==p[nec].y && p[i].x<p[nec].x))nec=i;
		}
		P ch=p[nec];
		ll cnt=0;
		for(ll i=0;i<n;i++){
			if(used[i])continue;
			pp[cnt++]=p[i]-ch;
		}
		sort(pp,pp+n-turn);
		for(ll i=3;i<=cnt;i++){
			for(ll j=0;j<=cnt;j++){
				for(ll k=0;k<=cnt;k++){
					dp[i][j][k]=INF;
				}
			}
		}
		for(ll i=1;i<cnt;i++){
			for(ll j=i+1;j<cnt;j++){
				ll cross=pp[i].x*pp[j].y-pp[j].x*pp[i].y;
				if(cross>0){
					dp[3][i][j]=cross;
					poll[3][i][j][0]=0;
					poll[3][i][j][1]=i;
					poll[3][i][j][2]=j;
					if(dp[3][i][j]<res[3]){
						res[3]=dp[3][i][j];
						respoll[3][0]=pp[0].id;
						respoll[3][1]=pp[i].id;
						respoll[3][2]=pp[j].id;
					}
				}else dp[3][i][j]=INF;
			}
		}
		for(ll i=3;i<cnt;i++){
			for(ll j=1;j<cnt;j++){
				for(ll k=j+1;k<cnt;k++){
					for(ll l=k+1;l<cnt;l++){
						ll cross=pp[k].x*pp[l].y-pp[k].y*pp[l].x;
						ll cross2=(pp[poll[i][j][k][i-2]].x-pp[k].x)*(pp[l].y-pp[k].y)-(pp[poll[i][j][k][i-2]].y-pp[k].y)*(pp[l].x-pp[k].x);
						if(cross>0 && cross2<0 && cross+dp[i][j][k]<dp[i+1][j][l]){
							dp[i+1][j][l]=cross+dp[i][j][k];
							for(ll m=0;m<i;m++)poll[i+1][j][l][m]=poll[i][j][k][m];
							poll[i+1][j][l][i]=l;
							if(dp[i+1][j][l]<res[i+1]){
								res[i+1]=dp[i+1][j][l];
								for(ll m=0;m<i+1;m++)respoll[i+1][m]=pp[poll[i+1][j][l][m]].id;
							}
						}
					}
				}
			}
		}
		used[nec]=true;
	}
	scanf("%d",&q);
	for(ll i=0;i<q;i++){
		ll que;
		scanf("%d",&que);
		if(res[que]==INF)prllf("NA\n");
		else{
			for(ll i=0;i<que;i++){
				prllf("%d%c",respoll[que][i],i==que-1?'\n':' ');
			}
		}
	}
	return 0;
}

Compiler output:
a.cc:38:1: error: '::main' must return 'int'
   38 | ll main(void){
      | ^~
a.cc: In function 'int main()':
a.cc:109:34: error: 'prllf' was not declared in this scope
  109 |                 if(res[que]==INF)prllf("NA\n");
      |                                  ^~~~~
a.cc:112:33: error: 'prllf' was not declared in this scope
  112 |                                 prllf("%d%c",respoll[que][i],i==que-1?'\n':' ');
      |                                 ^~~~~
Language: C++

#include<iostream>
using namespace std;

int j,y;
void dfs(int a,int b,string game){
  if(a==j && b==y){
    cout<< game<< endl;
    return;
  }
  else if(a>j || b>y) return;
  else if((a<3 && b==5) || (a==5 && b<3)) return;
  
  dfs(a+1,b,game+'A'); 
  dfs(a,b+1,game+'B');
}

main(){
  cin>> j>> y;
  dfs(0,0,

Compiler output:
a.cc:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   17 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:19:11: error: expected primary-expression at end of input
   19 |   dfs(0,0,
      |           ^
a.cc:19:11: error: expected '}' at end of input
a.cc:17:7: note: to match this '{'
   17 | main(){
      |       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
string keiro[100000];
void tansaku(int J,int Y,string now);
int j,y;
main(){
  cin>>j>>y;
  tansaku(0,0,"");
}
void tansaku(int J,int Y,string now){
  if(J==j&&Y==y){
    cout<<now<<endl;
    return;
  }
  if(J>j || Y>y)
    return;
  
  if(b<5||(b==5&&a==4)){
    tansaku(J+1,Y,now+"A");
  }
  
  if(a<5||(a==5&&b==4)){
    tansaku(J,Y+1,now+"B");
  }
  return;
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'void tansaku(int, int, std::string)':
a.cc:18:6: error: 'b' was not declared in this scope
   18 |   if(b<5||(b==5&&a==4)){
      |      ^
a.cc:18:18: error: 'a' was not declared in this scope
   18 |   if(b<5||(b==5&&a==4)){
      |                  ^
a.cc:22:6: error: 'a' was not declared in this scope
   22 |   if(a<5||(a==5&&b==4)){
      |      ^
a.cc:22:18: error: 'b' was not declared in this scope
   22 |   if(a<5||(a==5&&b==4)){
      |                  ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string score;
string ans[127];
string win;
int a,b;
int cou;

void saiki(int ac,int bc ,int d) {
  
  if(d == a+b && (score[a+b-1] == win[0] || win[0] == 'd') ) {
    cou++;
    for(int i=0;i<a+b;i++) ans[cou-1] += score[i];
   
    }
    
    if(a+b > d) {
      if(ac < a) {
	score[d] = 'A';
	saiki(ac+1,bc,d+1);
      }
      if(bc < b) {
	score[d] = 'B';
	saiki(ac,bc+1,d+1);
      }
    }
    
}

int main(){


  cin >> a >> b;
  
  win = "d";
  score.resize(a+b);
  if(a > b && (a >= 5 && b != 4) || a == 6) win = "A";
  else if(b > a && (b >= 5 && a !=4) || b == 6) win = "B";
  //  cout << win << endl;

  cou = 0;
  saiki(0,0,0);

  
  sort(ans,ans+cou);

  for(int i=0;i<cou;i++) {
    cout << ans[i] << endl;
  }


  return 0;
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string score;
string ans[127];
string win;
int a,b;
int cou;

void saiki(int ac,int bc ,int d) {
  
  if(d == a+b && (score[a+b-1] == win[0] || win[0] == 'd') ) {
    cou++;
    for(int i=0;i<a+b;i++) ans[cou-1] += score[i];
   
    }
    
    if(a+b > d) {
      if(ac < a) {
	score[d] = 'A';
	saiki(ac+1,bc,d+1);
      }
      if(bc < b) {
	score[d] = 'B';
	saiki(ac,bc+1,d+1);
      }
    }
    
}

int main(){


  cin >> a >> b;
  
  win = "d";
  score.resize(a+b);
  if(a > b && (a >= 5 && b != 4) || a == 6) win = "A";
  else if(b > a && (b >= 5 && a !=4) || b == 6) win = "B";
  //  cout << win << endl;

  cou = 0;
  saiki(0,0,0);

  
  sort(ans,ans+cou);

  for(int i=0;i<cou;i++) {
    cout << ans[i] << endl;
  }


  return 0;

}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:34: error: a function-definition is not allowed here before '{' token
   65 | void saiki(int ac,int bc ,int d) {
      |                                  ^
a.cc:86:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   86 | int main(){
      |         ^~
a.cc:86:9: note: remove parentheses to default-initialize a variable
   86 | int main(){
      |         ^~
      |         --
a.cc:86:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:86:11: error: a function-definition is not allowed here before '{' token
   86 | int main(){
      |           ^
Language: C++

#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
int a, b;
int main() {
	scanf("%d%d", &a, &b);
	if(a + b != 10) {
		for(int i = 0; i < (1 << (a + b)); i++) {
			if(__popcnt(i) == a) {
				for(int j = 0; j < a + b; j++) {
					if(i & (1 << j)) printf("A");
					else printf("B");
				}
				printf("\n");
			}
		}
	}
	else {
		for(int i = 0; i < 256; i++) {
			string s;
			if(__popcnt(i) == 4) {
				for(int j = 0; j < 8; j++) {
					if(i & (1 << j)) s += "A";
					else s += "B";
				}
			}
			if(a == 6 && b == 4) cout << s << "AA" << endl;
			if(a == 5 && b == 5) cout << s << "AB" << endl << s << "BA" << endl;
			if(a == 4 && b == 6) cout << s << "BB" << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: '__popcnt' was not declared in this scope
   10 |                         if(__popcnt(i) == a) {
      |                            ^~~~~~~~
a.cc:22:28: error: '__popcnt' was not declared in this scope
   22 |                         if(__popcnt(i) == 4) {
      |                            ^~~~~~~~
Language: C++

#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

greater < string()>;
//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"
set<string>getans(const int j, const int y, const int nj, const int ny) {

	{
		set<string>sets;
		if (j > nj) {
			const int nextj = nj + 1;
			const int nexty = ny;
			if (nextj == j&&nexty == y) {
				sets.emplace("A");
			}
			if ((nextj>=5||nexty>=5)&&abs(nextj-nexty)>1) {
				
			}
			else {
				
				set<string>aset(getans(j, y, nextj, nexty));
				for (auto s : aset) {
					s = "A" + s;
					sets.emplace(s);
				}
			}
		}
		if (y > ny) {
			const int nextj = nj ;
			const int nexty = ny + 1;
			if (nextj == j&&nexty == y) {
				sets.emplace("B");
			}
			if ((nextj >= 5 || nexty >= 5) && abs(nextj - nexty)>1) {

			}
			else {
				set<string>aset(getans(j, y, nextj, nexty));
				for (auto s : aset) {
					s = "B" + s;
					sets.emplace(s);
				}
			}
		}
		return sets;
	}
}
int main() {
	int j, y; cin >> j >> y;
	set<string>anss(getans(j, y, 0, 0));
	
	for (auto ans : anss) {
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc:11:1: error: declaration does not declare anything [-fpermissive]
   11 | greater < string()>;
      | ^~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<unordered_map>
using namespace std;

int a[10000][10000];
int main() {
	memset(a, 0, sizeof(a));
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,ml,bu;
  cin>>n>>m;
  vector<int>a,b,c;
  int x,y,z;
  while(cin>>x>>y>>z,x){
    a.push_back(x-1);
    b.push_back(y-1);
    c.push_back(z);
  }
  cin >> l;
  vector<int>d(m);
  for(int i=0;i<l;i++){
    vector<int>co(n);
    for(int j=0;j<m;j++){
      cin>>bu;
      d[j]=bu;
    }
    for(int j=0;j<a.size();j++)
      co[a[j]]+=d[b[j]]*c[j];
    for(int j=0;j<n;j++){
      cout << co[j] ;
      if(j+1!=n)
    cout<<' ';
    }
    cout<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: 'm' was not declared in this scope; did you mean 'ml'?
    5 |   cin>>n>>m;
      |           ^
      |           ml
a.cc:13:10: error: 'l' was not declared in this scope
   13 |   cin >> l;
      |          ^
Language: C++

/* ?????¢????????¨?????? 586 + 79 = 665(KiB) ??????????????????????????? */
/* ????´°??????????????§ */
#include <iostream>
#include <vector>
#include <cstdio>

struct JobRecord
{
	int staff;
	int job;
	int count;
};

int main(void)
{
	using namespace std;

	int num_of_staffs, num_of_jobs;
	cin >> num_of_staffs >> num_of_jobs;

	vector<JobRecord> v_job_record;
	vector<int> v_staff, v_job, v_count;

	/* ??\???????¨?????????????????????? */
	/* ?????§ 50000 ?????????????????? */
	/* ????????§?????¢????????¨?????? 50000(???) * 3(??????, ??????????¨????, ?????°) * 4(Bytes) = 600000(Bytes) ==> ?´?586KiB */
	while(1)
	{
		JobRecord input;
		cin >> input.staff >> input.job >> input.count;
		if( input.staff == 0 && input.job == 0 && input.count == 0 )
		{
			break;
		}
		
		/* ??\??????????????? */
		v_job_record.push_back(input);
	}

	int num_of_calc;
	cin >> num_of_calc;

	/* ???????¨???? */
	for(int calc_count = 0; calc_count < num_of_calc; calc_count++)
	{
		/* ???????¨???????????????§?????¢????????¨??????????¨??????¨?????? */
		/*   v_unit_price : 10000(??\???????¨?????????§) * 4 = 40000 Bytes */
		/*   v_salary     : 10000(????????°?????§)     * 4 = 40000 Bytes */
		/* ????¨???§ 80000 Bytes ==> ?´? 79 KiB */
		vector<int> v_unit_price(num_of_jobs);	/* ???????????¨????????? */
		vector<int> v_salary(num_of_staffs, 0);	/* ???????????¨?????????. ????????? 0 ????????????????¨???? */

		/* ??\??? */
		for(int job = 0; job < num_of_jobs; job++)
		{
			cin >> v_unit_price[job];
		}

		/* ?¨???? */
		for(int i = 0; i < v_job_record.size(); i++)
		{
			/* ???????????\???????¨??????? 1????????????????????§?????????????????????????????¨???????????? 0??????????????????????????? */
			int staff      = v_job_record[i].staff;
			int job        = v_job_record[i].job;
			int count      = v_job_record[i].count;
			int unit_price = v_unit_price[ job - 1 ];
			
			v_salary[ staff - 1 ] += unit_price * count;
		}
		
		/* ?????? */
		for(auto salary : v_salary)
		{
			printf(salary != v_salary[num_of_staffs - 1] ? "%d ":"%d\n", v_salary[j]);
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:95: error: 'j' was not declared in this scope
   74 |                         printf(salary != v_salary[num_of_staffs - 1] ? "%d ":"%d\n", v_salary[j]);
      |                                                                                               ^
Language: Java

import java.util.Scanner;
import java.math.BigInteger;

public class Jinkoki {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);

        String units[] = {"Man","Oku","Cho","Kei","Gai","Jo","Jou","Ko","Kan",
                          "Sei","Sai","Gok","Ggs","Asg","Nyt","Fks","Mts"};
        while(sc.hasNext()){
            String m = sc.next();
            int n = sc.nextInt();
            if(n == 0) break;
            BigInteger bi = new BigInteger(m);
            bi = bi.pow(n);
            for(int i = 68; i >= 4; i -= 4){
                BigInteger div = new BigInteger("10");
                if(bi.divide(div.pow(i)).signum() == 1){
                    System.out.printf("%s%s",bi.divide(div.pow(i)),units[i / 4 - 1]);
                    bi = bi.remainder(div.pow(i));
                }
            }
            if(bi.signum() == 1){
                System.out.print(bi);
            }
            System.out.println();
        }
    }
}

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

package Jinkoki;

import java.util.Scanner;
import java.math.BigInteger;

public class Jinkoki {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);

        String units[] = {"Man","Oku","Cho","Kei","Gai","Jo","Jou","Ko","Kan",
                          "Sei","Sai","Gok","Ggs","Asg","Nyt","Fks","Mts"};
        while(sc.hasNext()){
            String m = sc.next();
            int n = sc.nextInt();
            if(n == 0) break;
            BigInteger bi = new BigInteger(m);
            bi = bi.pow(n);
            for(int i = 68; i >= 4; i -= 4){
                BigInteger div = new BigInteger("10");
                if(bi.divide(div.pow(i)).signum() == 1){
                    System.out.printf("%s%s",bi.divide(div.pow(i)),units[i / 4 - 1]);
                    bi = bi.remainder(div.pow(i));
                }
            }
            if(bi.signum() == 1){
                System.out.print(bi);
            }
            System.out.println();
        }
    }
}

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

import java.util.*;

public class Main {
   public static void main(String[] args) throws Exception {
       String [] unit = {"","Man","Oku","Cho","Kei","Gai","Jo","Jou","Ko","Kan","Sei","Sai","Gok","Ggs","Asg","Nyt","Fks","Mts"};
       Scanner sc = new Scanner(System.in);
       while(sc.hasNextInt()){
           int m = sc.nextInt();
           int n = sc.nextInt();
           if(m==0 && n==0) break;
           Math.BigInteger b = valueOf(Math.pow(m,n));
           
           String ans = "";
           for(int i=0;i<18;i++){
               String digit = remainder(b,10000);
               ans = digit.concat(unit[i]+ans);
               b = divide(b,10000);
           }
           System.out.println(ans);
       }
   }
}


Compiler output:
Main.java:11: error: cannot find symbol
           Math.BigInteger b = valueOf(Math.pow(m,n));
               ^
  symbol:   class BigInteger
  location: class Math
Main.java:11: error: cannot find symbol
           Math.BigInteger b = valueOf(Math.pow(m,n));
                               ^
  symbol:   method valueOf(double)
  location: class Main
2 errors
Language: C

a[];main(n,m,i,*p){for(;scanf("%d%d",&m,&n)*n;puts(a))for(*a=1;~n--;)for(i=18;i;*p=~n?p[1]+=*p*m/1e4,*p*m%10000:*p&&!printf("%d%.3s",*p,51-i*3+"MtsFksNytAsgGgsGokSaiSeiKanKo\0JouJo\0GaiKeiChoOkuMan"))p=a+--i;}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | a[];main(n,m,i,*p){for(;scanf("%d%d",&m,&n)*n;puts(a))for(*a=1;~n--;)for(i=18;i;*p=~n?p[1]+=*p*m/1e4,*p*m%10000:*p&&!printf("%d%.3s",*p,51-i*3+"MtsFksNytAsgGgsGokSaiSeiKanKo\0JouJo\0GaiKeiChoOkuMan"))p=a+--i;}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:16: error: expected ')' before '*' token
    1 | a[];main(n,m,i,*p){for(;scanf("%d%d",&m,&n)*n;puts(a))for(*a=1;~n--;)for(i=18;i;*p=~n?p[1]+=*p*m/1e4,*p*m%10000:*p&&!printf("%d%.3s",*p,51-i*3+"MtsFksNytAsgGgsGokSaiSeiKanKo\0JouJo\0GaiKeiChoOkuMan"))p=a+--i;}
      |                ^
      |                )
main.c:1:1: warning: array 'a' assumed to have one element
    1 | a[];main(n,m,i,*p){for(;scanf("%d%d",&m,&n)*n;puts(a))for(*a=1;~n--;)for(i=18;i;*p=~n?p[1]+=*p*m/1e4,*p*m%10000:*p&&!printf("%d%.3s",*p,51-i*3+"MtsFksNytAsgGgsGokSaiSeiKanKo\0JouJo\0GaiKeiChoOkuMan"))p=a+--i;}
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
string s[]={ "","Man","Oku","Cho","Kei","Gai","Jo","Jou","Ko","Kan","Sei","Sai","Gok","Ggs","Asg","Nyt","Fks","Mts" };
main(){
  int n,m;
  while(cin>>m>>n,m){
    int a[18]={};
    a[0]
    for(int i=0;i<n;i++)
      for(int j=17;j>=0;j--){
        a[j]*=m;
        a[j+1]+=a[j]/10000;
        a[j]=a[j]%10000;
      }
    for(int i=17;i>=0;i--)if(a[i])cout<<a[i]<<s[i];
    cout<<endl;
  }
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:9: error: expected ';' before 'for'
    8 |     a[0]
      |         ^
      |         ;
    9 |     for(int i=0;i<n;i++)
      |     ~~~  
a.cc:9:17: error: 'i' was not declared in this scope
    9 |     for(int i=0;i<n;i++)
      |                 ^
a.cc:10:20: error: 'j' was not declared in this scope
   10 |       for(int j=17;j>=0;j--){
      |                    ^
Language: C++

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

int d, n, dp[111][111];
int a[111], e[111], r[111];

int rec(int exp, int hp){
    
    if(hp <= 0) return 0;
    
    int ret = INF;
    for(int i = 0; i < n; i++){
        if(r[i] <= exp)
            ret = min(ret, rec(exp + e[i], hp - a[i]) + 1);
    }
    return dp[exp][hp] = ret;
}

int main(){
    
    while(cin >> d >> n, d||n){
        for(int i = 0; i < n; i++) cin >> a[i] >> e[i] >> r[i];
    
        memset(dp, -1, sizeof(dp));
        int dd = rec(0, d);
        if(dd == INF) cout << "NA" << endl;
        else cout << dd << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: 'memset' was not declared in this scope
   26 |         memset(dp, -1, sizeof(dp));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | #define INF (2 << 28)