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

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
using vll=vector<ll>;

vll matmul(vll a, vll b){
	int n=a.size();
	vll d(n,0);
	vll r(n,0);
	rep(i,n)rep(j,n){
		d[j]|=b[j]&(1<<(n-i-1));
	}
	rep(i,n)rep(j,n){
		r[i][j]=!!(a[i]&d[j]);
	}
	return r;
}

vector<vll> memo(101);
vll matpow(vll a,int p){
	if(memo[p].size()==0)
		memo[p]=(p&1)?matmul(matpow(a,p-1),a):matmul(matpow(a,p/2),matpow(a,p/2));
	return memo[p];
}

int main(){
	int n,m,a[3];
	while(cin>>n>>m>>a[0]>>a[1]>>a[2]){
		vll z(n,0), e=z;
		rep(_,m){
			int p,q; cin>>p>>q;
			e[p-1]|=1<<(n-q);
		}
		fill(all(memo),vll());
		memo[1]=e;

		vector<vll> d(3);
		rep(p,3) d[p]=matpow(e,a[p]);
		
		vi g(n,0), ng(n,0);
		g[n-1]=1;
		rep(t,1000){
			bool next=0;
			fill(all(ng),0);
			rep(i,n) if(!g[i]){
				bool ok=1,r;
				rep(p,3) [&]{r=0; rep(j,n) r|=(g[j]&!!(d[p][i]&(1<<(n-j-1)))); ok&=r;}();
				if(ok) ng[i]=next=1;
			}
			if(!next){
				cout<<"IMPOSSIBLE"<<endl;
				break;
			} else if(ng[0]){
				cout<<t+1<<endl;
				break;
			}
			rep(i,n)g[i]|=ng[i];
		}
	}
	return 0;
}



Compiler output:
a.cc: In function 'vll matmul(vll, vll)':
a.cc:18:21: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[int]' for array subscript
   18 |                 r[i][j]=!!(a[i]&d[j]);
      |                     ^
Language: C++

#include<bits/stdc++.h>
#define N 1005
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> P1;
int n,w,d,x,y,ans;
vector<P1> v;
char f;
stack<P> q;
bool used[N];

void add_point(int num){
  if(f=='N'){
    if(x+y<d)v.push_back(P1(P(x+y+w*2+d,0),num));
    else v.push_back(P1(P(x+y-d,0),num));
    if(w+y-x<d)v.push_back(P1(P(d-(w+y-x)+w,1),num));
    else v.push_back(P1(P(d-(y-x),1),num));
  }
  if(f=='E'){
    if(d-(y-x)<w)v.push_back(P1(P(d-(y-x),0),num));
    else v.push_back(P1(P(d-(w+(y-x))+w,0),num));
    if(y+x<w)v.push_back(P1(P(w-(y+x)+w+d,1),num));
    else v.push_back(P1(P(d-(-w+y+x)+w,1),num));
  }
  if(f=='S'){
    if(0<=-w+y+x)v.push_back(P1(P(d-(-w+y+x)+w,0),num));
    else v.push_back(P1(P(w-(y+x)+w+d,0),num));
    if(0<=y-x)v.push_back(P1(P(y-x+w*2+d,1),num));
    else v.push_back(P1(P(w-(-(y-x))+w+d,1),num));
  }
  if(f=='W'){
    if(0<=-(y-x))v.push_back(P1(P(w-(-(y-x))+w+d,0),num));
    else v.push_back(P1(P(y-x+w*2+d,0),num));
    if(0<=y+x-d)v.push_back(P1(P(y+x-d,1),num));
    else v.push_back(P1(P(y-x+w*2+d,1),num));
  }
}

bool usednum[500000];

void solve(){
  int len=v.size(),cnt;
  for(int i=0;i<len;i++){
    memset(used,0,sizeof(used));
    memset(usednum,0,sizeof(usednum));
    if(v[i].first.second)continue;
    useds[v[i].second]=true;
    cnt=0;
    for(int j=i;j<len+i;j++){
      int idx=j%len;
      if(used[v[idx].second])continue;
      if(!v[idx].first.second){
	useds[v[idx].second]=true;
	q.push(P(v[idx].second,v[idx].first.first));
      }
      else{
	cnt++;
	if(usednum[v[idx].first.first])cnt--;
	usednum[v[idx].first.first]=true;
	while(!q.empty()){
	  P num=q.top(); q.pop();
	  used[num.first]=true;
	  if(num.first==v[idx].second)break;
	}
      }
    }
    ans=min(ans,cnt);
  }
}

int main(){
  cin>>n>>w>>d;
  for(int i=0;i<n;i++){
    cin>>x>>y>>f;
    add_point(i);
  }
  sort(v.begin(),v.end());
  ans=(1e9);
  solve();
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:47:5: error: 'useds' was not declared in this scope; did you mean 'used'?
   47 |     useds[v[i].second]=true;
      |     ^~~~~
      |     used
Language: C++

#include<bits/stdc++.h>
#define N 1005
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> P1;
int n,w,d,x,y,ans;
vector<P1> v;
char f;
stack<P> q;
bool used[N];

void add_point(int num){
  if(f=='N'){
    if(x+y<d)v.push_back(P1(P(x+y+w*2+d,0),num));
    else v.push_back(P1(P(x+y-d,0),num));
    if(w+y-x<d)v.push_back(P1(P(d-(w+y-x)+w,1),num));
    else v.push_back(P1(P(d-(y-x),1),num));
  }
  if(f=='E'){
    if(d-(y-x)<w)v.push_back(P1(P(d-(y-x),0),num));
    else v.push_back(P1(P(d-(w+(y-x))+w,0),num));
    if(y+x<w)v.push_back(P1(P(w-(y+x)+w+d,1),num));
    else v.push_back(P1(P(d-(-w+y+x)+w,1),num));
  }
  if(f=='S'){
    if(0<=-w+y+x)v.push_back(P1(P(d-(-w+y+x)+w,0),num));
    else v.push_back(P1(P(w-(y+x)+w+d,0),num));
    if(0<=y-x)v.push_back(P1(P(y-x+w*2+d,1),num));
    else v.push_back(P1(P(w-(-(y-x))+w+d,1),num));
  }
  if(f=='W'){
    if(0<=-(y-x))v.push_back(P1(P(w-(-(y-x))+w+d,0),num));
    else v.push_back(P1(P(y-x+w*2+d,0),num));
    if(0<=y+x-d)v.push_back(P1(P(y+x-d,1),num));
    else v.push_back(P1(P(y-x+w*2+d,1),num));
  }
}

bool usednum[500000];

void solve(){
  int len=v.size(),cnt;
  for(int i=0;i<len;i++){
    memset(used,0,sizeof(used));
    memset(usednum,0,sizeof(usednum));
    if(v[i].first.second)continue;
    cnt=0;
    for(int j=i;j<len+i;j++){
      int idx=j%len;
      if(used[v[idx].second])continue;
      if(!v[idx].first.second){
	useds[v[idx].second]=true;
	q.push(P(v[idx].second,v[idx].first.first));
      }
      else{
	cnt++;
	if(usednum[v[idx].first.first])cnt--;
	usednum[v[idx].first.first]=true;
	while(!q.empty()){
	  P num=q.top(); q.pop();
	  used[num.first]=true;
	  if(num.first==v[idx].second)break;
	}
      }
    }
    ans=min(ans,cnt);
  }
}

int main(){
  cin>>n>>w>>d;
  for(int i=0;i<n;i++){
    cin>>x>>y>>f;
    add_point(i);
  }
  sort(v.begin(),v.end());
  ans=(1e9);
  solve();
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:52:9: error: 'useds' was not declared in this scope; did you mean 'used'?
   52 |         useds[v[idx].second]=true;
      |         ^~~~~
      |         used
Language: C++

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

#define SLL(a) scanf("%lld",&a)
#define LL long long int
#define mp make_pair

LL n,ss,pp,dp[15][3][130][30004],val[30004];
int dg[15],l,uid,tc,vis[15][3][130][30004];
//vector<int>dg;
char ch[15];
map< pair< pair<int,int> , pair<int,LL> >,LL >MP;
map<LL,int> hs;
LL go(int pos,int fl,int sum,int  id)
{
//    cout<<pos<<" "<<sum<<" "<<val[id]<<endl;
    if(sum>ss)return 0;
    else if(sum==ss && val[id]>pp)return 0;
    else if(sum==ss && val[id]==pp && fl==2)return 0;

//    if(fl==2 && sum==ss && prod==pp)return 0;

    if(pos==l && sum<ss)return 1;
    else if(pos==l && sum==ss && val[id]<pp)return 1;
    else if(pos==l && sum==ss && val[id]==pp && fl==1)return 1;
    else if(pos==l && sum==ss && val[id]==pp && fl!=1)return 0;
//    else if(pos==l)return 0;

//    if(MP.find(mp(mp(pos,fl),mp(sum,prod)))!=MP.end())return MP[mp(mp(pos,fl),mp(sum,prod) )];
    if(vis[pos][fl][sum][id]==tc)return dp[pos][fl][sum][id];
vis[pos][fl][sum][id]=tc;
    LL ret=0;
    int lm=dg[pos];
    if(fl==1)lm=9;
    if(fl==2)lm=9;
//    cout<<lm<<endl;
    for(int i=0;i<=9;i++)
    {
        LL gt =val[id]*(i+1);
        int nw_id;
        if(hs.find(gt)!=hs.end()) nw_id = hs[gt];
        else
        {
            uid++;
            hs[gt] = uid;
            val[uid]=gt;
            nw_id = uid;
        }
        if(fl==0 && i<lm)ret+=go(pos+1,1,sum+i,nw_id);
        else if(fl==0 && i==lm)ret+=go(pos+1,fl,sum+i,nw_id);
        else if(fl==0 && i>lm)ret+=go(pos+1,2,sum+i,nw_id);
        else if(fl==1 )ret+=go(pos+1,fl,sum+i,nw_id);
        else if(fl==2 )ret+=go(pos+1,fl,sum+i,nw_id);
    }
//    MP[mp(mp(pos,fl),mp(sum,prod) )]=ret;
    dp[pos][fl][sum][id]=ret;
    return ret;
}

int main()
{
	uid = 1;
	hs[1] = uid;
        val[uid]=1;
        tc=1;
    while(gets(ch))
    {
//        for(int i=0;i<14;i++)ch[i]='9';
        //MP.clear();
        l=strlen(ch);
        ss=0;
        pp=1;
        for(int i=0;i<l;i++)
        {
            dg[i]=ch[i]-'0';
            ss+=dg[i];
            pp*=(dg[i]+1);
//            cout<<dg[i]<<" ";
        }
//        puts("");
        //memset(dp,-1,sizeof dp);
        
        LL res=go(0,0,0,1);
        printf("%lld\n",res);
//        cout<<uid<<endl;
        //hs.clear();
//        memset()
		tc++;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
   66 |     while(gets(ch))
      |           ^~~~
      |           getw
Language: C

#include <bits/stdc++.h>
using namespace std;
#define LL long long
int N,M,x,y,pt;
LL b[50];
int C[50];
int st[50],ne[5010],go[5010];
class rec{
	public:
	int x,l;
	LL d;
	bool operator < (const rec &X)const{
		return l<X.l;
	}
	bool operator > (const rec &X)const{
		return l>X.l;
	}
}p1,p2;
class poi{
	public:
	LL d;
	int x;
	bool operator < (const poi &X)const{
		if (x!=X.x)return x<X.x;
		return d<X.d;
	}
};
set <poi> used;
priority_queue <rec ,vector <rec >, greater <rec > > heap;
void Add(int x,int y){ne[++pt]=st[x];st[x]=pt;go[pt]=y;}
int main() {
	scanf("%d%d",&N,&M);
	for (int i=0;i<N;i++)scanf("%d",&C[i]);
	for (int i=1;i<=M;i++){
		scanf("%d%d",&x,&y);
		x--;y--;
		Add(x,y);
		Add(y,x);
		b[x]|=1ll<<y;
		b[y]|=1ll<<x;
	}
	p1.x=0;p1.d=1;p1.l=C[0];
	for (int i=st[0];i;i=ne[i])
		p1.l+=C[go[i]];
	heap.push(p1);
	for (;;){
		p1=heap.top();
		heap.pop();
		if (used.find((poi){p1.d,p1.x})!=used.end())continue;
		if (p1.x==N-1)break;
		used.insert((poi){p1.d,p1.x});
		for (int i=st[p1.x];i;i=ne[i]){
			if ((p1.d>>go[i])&1)continue;
			if (b[go[i]]&(p1.d^(1ll<<p1.x)))continue;
			p2.x=go[i];p2.d=p1.d^(1ll<<go[i]);p2.l=p1.l;
			for (int j=st[p2.x];j;j=ne[j])
				if (!(b[go[j]]&p1.d))
					if (!((p1.d>>go[j])&1))
						p2.l+=C[go[j]];
			if (used.find((poi){p2.d,p2.x})!=used.end())continue;
			heap.push(p2);
		}
	}
	printf("%d\n",p1.l);
    return 0;
}

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

#include<stdio.h>
#include<vector>
#include<algorithm>
#define INF 0x3f3f3f3f
using namespace std;
vector<int>G[50];
int w[50],best,cnt[50],vis[50],n,b[50];
void dfs(int u, int pw)
{
	if (pw >= best||pw>b[u])return;
	b[u] = min(b[u], pw);
	int tem = 0;
	vis[u] = 1;
	if (!cnt[u])
		tem += w[u];
	cnt[u]++;
	for (int i = 0; i < G[u].size(); i++)
	{
		if (!cnt[G[u][i]])
			tem += w[G[u][i]];
		cnt[G[u][i]]++;
	}
	if (u == n)
	{
		best = min(pw + tem, best);
		goto x;
	}
	for (int i = 0; i < G[u].size(); i++)
	{
		if (!vis[G[u][i]])
		{
			vis[G[u][i]] = 1;
			dfs(G[u][i], pw+tem);
			vis[G[u][i]] = 0;
		}
	}
	x:for (int i = 0; i < G[u].size(); i++)
		cnt[G[u][i]]--;
	 cnt[u]--;
}
int main()
{
	int m;
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++)scanf("%d", &w[i]);
	for (int i = 0,u,v; i < m; i++)
	{
		scanf("%d%d", &u, &v);
		G[u].push_back(v);
		G[v].push_back(u);
	}
	best = INF;
	memset(b, 0x3f, sizeof b);
	dfs(1,0);
	printf("%d\n", best);
}

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

#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<vector>
#define mem(a) memset(a,0,sizeof(a))
#define LL long long
using namespace std;
const int MAXN = 45;
int n, m;
int weight[MAXN];
int map[MAXN][MAXN];
int vis[MAXN];
int maxn=0;
int visflag[MAXN];
int visnode[MAXN][MAXN];
int ans = 0x3f3f3f3f;
int passvalue[MAXN];
vector<int > visvec[MAXN];
void dfs(int s,int t,int temp) {
	if (s == 1 && t == n) {
		for (int i = 1; i <= n; i++) {
			if (map[1][i] == 1||map[n][i]==1) {
				vis[i] = 1;
				temp += weight[i];
			}
		}
		vis[s] = 1;
		temp += weight[s];
		vis[t] = 1;
		temp += weight[t];
	}
	if (s == t) {
		ans = min(ans, temp);
		return;
	}
	if (temp >= ans) {
		return;
	}
	if (temp >= maxn) {
		ans = maxn;
		return;
	}
	if (temp > passvalue[s])
		return;
	for (int i = 1; i <= n; i++) {
		if (map[s][i]&&!visnode[s][i]&&visflag[i]==0) {
			visflag[i] = 1;
			visnode[s][i] = 1;
			visnode[i][s] = 1;
			if (vis[i] == 0) {
				temp += weight[i];
				visvec[i].push_back(i);
				vis[i] = 1;
			}
			for (int j = 1; j <= n; j++) {
				if (vis[j] == 0 && map[i][j]) {
					temp += weight[j];
					vis[j] = 1;
					visvec[i].push_back(j);
				}
			}
			passvalue[s] = min(temp,passvalue[s]);
			dfs(i, t, temp);
			visflag[i] = 0;
			visnode[s][i] = 0;
			visnode[i][s] = 0;
			for (int j = 0; j < visvec[i].size(); j++) {
				int t = visvec[i][j];
				temp -= weight[t];
				vis[t] = 0;
			}
			visvec[i].clear();
		}
	}
}
int main() {
		scanf("%d%d", &n, &m);
		mem(weight); ans = 0; mem(map); mem(vis); mem(visnode); maxn = 0; mem(visflag);
		for (int i = 0; i < MAXN; i++)
			passvalue[i] = INT_MAX;
		ans = 0x3f3f3f3f;
		for (int i = 0; i < MAXN; i++) visvec[i].clear();
		for (int i = 1; i <= n; i++)
			scanf("%d", &weight[i]);
		for (int i = 1; i <= n; i++) {
			maxn += weight[i];
		}
		for (int i = 1; i <= m; i++) {
			int a, b;
			scanf("%d%d", &a, &b);
			map[a][b] = 1;
			map[b][a] = 1;
		}
		int temp = 0;
		dfs(1, n,temp);
		printf("%d\n", ans);
	//	system("pause");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:81:40: error: 'INT_MAX' was not declared in this scope
   81 |                         passvalue[i] = INT_MAX;
      |                                        ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include<vector>
  +++ |+#include <climits>
    6 | #define mem(a) memset(a,0,sizeof(a))
Language: C

#include<stdio.h>
#include<stdlib.h>

int main(){
  int n,m;
  scanf("%d %d",&n,%m);
  int input[m], flag[m];
  int i;
  for(i=1;i<m;i++){
    scanf("%d",&input[i]);
  }

  for(i=m-1;i>=0;i--){
    if(flag[input[i]]==0){
      printf("%d\n",input[i]);
      flag[input[i]]=i;
    }
  }
  for(i=0;i<n;i++){
    if(flag[i]==0){
      printf("%d\n",input[i]);
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:20: error: expected expression before '%' token
    6 |   scanf("%d %d",&n,%m);
      |                    ^
Language: C

#include<stdio.h>
#include<stdlib.h>
 
int main(){
  int n,m;
  scanf("%d %d",&n,%m);
  int input[m], flag[n];
  int i;
  for(i=1;i<m;i++){
    scanf("%d",&input[i]);
  }
 
  for(i=m-1;i>=0;i--){
    if(flag[input[i]]==0){
      printf("%d\n",input[i]);
      flag[input[i]]=i;
    }
  }
  for(i=0;i<n;i++){
    if(flag[i]==0){
      printf("%d\n",input[i]);
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:20: error: expected expression before '%' token
    6 |   scanf("%d %d",&n,%m);
      |                    ^
Language: C

#include<stdio.h>

int main(void){
  int n,m;
  int i,j,k;
  int tmp[];
  int req[100001],fin[200001];
  scanf("%d %d",&n,&m);
  for(i=0;i<m;i++){
    scanf("%d",&req[i]);
  }
  for(i=m;i>=0;i--){
    for(j=0;j<i;j++){
      if(req[j] == req[i]){
	req[j]=0;
      }
    }
  }
  //  putchar('\n');
  for(i=0;i<n;i++){
    tmp[i]=i+1;
    // printf("%d\n",tmp[i]);
  }
  /* putchar('\n');
  for(j=0;j<m;j++){
    printf("%d\n",req[j]);
    }*/
  //  putchar('\n');
  for(k=0;k<n;k++){
    if(req[m-k-1] && (m-k-1)>=0){
    fin[k]=req[m-k-1];
    printf("%d\n",fin[k]);
    tmp[fin[k]-1]=0;
    }
  }
  for(k=0;k<n;k++){
    if(tmp[k]){
      printf("%d\n",tmp[k]);
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:7: error: array size missing in 'tmp'
    6 |   int tmp[];
      |       ^~~
Language: C

#include <bits/stdc++.h>

using namespace std;

int ar[200005];
int n,m,x;
stack<int> st;

int main()
{
    while(scanf("%d %d",&n,&m)!=EOF)
    {
        for(int i=n; i>0; i--)
        {
            ar[i]=0;
            st.push(i);
        }
        for(int i=0; i<m; i++)
        {
            scanf("%d",&x);
            st.push(x);
        }

        while(!st.empty())
        {
            int y= st.top();
            st.pop();
            if(ar[y]==1) continue;
            printf("%d\n", y);
            ar[y]=1;
        }
    }
}

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

#include <bits/stdc++.h>
using namespace std;
#define N 200005
int a[N],flag[N];
int n,m;
int main()
{
    cin>>n>>m;
    for (int i=1;i<=m;++i) scanf("%d",&a[i]);
    for (int i=m;i;--i)
    {
        if (flag[a[i]]) continue;
        flag[a[i]]=1;
        printf("%d\n",a[i]);
    }
    for (int i=1;i<=n;++i) if (!flag[i]) printf("%d\n",i);
}

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

#include<bits/stdc++.h>

using namespace std;

const int maxn=2*100005;

int a[maxn],num=0;
bool vis[maxn];

int main()
{
	int n,m;
	int x;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++){
		scanf("%d",&x);
		a[++num]=x;
		vis[x]=1;
	}
	for(int i=num;i>=1;i--){
		printf("%d\n",a[i]);
	}
	for(int i=1;i<=n;i++){
		if(vis[i]==0)printf("%d\n",i);
	}
	return 0;
}

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

#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int n,m,a[200000],b[200000],x;
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=n;i>=1;i--)
	{
		a[i]=n-i+1;
	}
	for (int i=1;i<=m;i++)
	{
		scanf("%d",&x);
		a[n+i]=x;
	}
	for (int i=n+m;i>=1;i--)
	if (!b[a[i]])
	{
		b[a[i]]=1;
		printf("%d\n",a[i]);
	}
}

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

#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <iostream>
using namespace std;
int a[200005], b[100005];

int main()
{
	int n;
	int m;
	while (cin >> n >> m)
	{
		memset(a, 0, sizeof(a));
		memset(b, 0, sizeof(b));
		int l = 0;
		while (m--)
		{
			int x;
			scanf("%d", &x);
			b[l++] = x;
		}
		for (int i = l - 1; i >= 0; i--)
		{
			if (a[b[i]] == 0)
			{
				printf("%d\n", b[i]);
				a[b[i]] = 1;
			}
		}
		for (int i = 1; i <= n; i++)
		{
			if (a[i] == 0)
				printf("%d\n", i);
		}

	}

	return 0;
}

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

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

int main(){
    int i,n,c,m,buf;
    cin>>n>>m;
    deque<int> l(n);
    for(i=0;i<n;i++){
        l[i]=i+1;
    }
    for(i=0;i<m;i++){
        cin>>c;
        auto r=find(l.begin(),l.end(),c);
        buf=(*r);
        l.erase(r);
        l.push_front(buf);
    }
    for(i=0;i<n;i++){
        cout<<l[i]<<endl;
    }
    return 0;
} 



Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: no matching function for call to 'find(std::deque<int>::iterator, std::deque<int>::iterator, int&)'
   14 |         auto r=find(l.begin(),l.end(),c);
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:14:20: note:   'std::_Deque_iterator<int, int&, int*>' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
   14 |         auto r=find(l.begin(),l.end(),c);
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<vector>
#include<map>
#include<utility>

using namespace std;

bool mycomp1(pair<int,int> a, pair<int,int>b){
	return a.second>b.second;	
}

bool mycomp2(pair<int,int> a, pair<int,int>b){
	return a.first<b.first;
}

map<int, int> update;
int main(){
	int n,m;
	scanf("%d %d", &n, &m);

	for(int i=0;i<m;i++){
		int r;
		scanf("%d", &r);
		update[r] = i;
	}

	vector<pair<int,int> > requests;
	for(map<int, int>::iterator it=update.begin(); it!=update.end(); it++){
		requests.push_back(pair<int,int>(it->first, it->second));
	}

	std::sort(requests.begin(), requests.end(), mycomp1);

	for(int i=0;i<requests.size();i++){
		printf("%d\n", requests[i].first);
	}


	std::sort(requests.begin(), requests.end(), mycomp2);
	int now = 0;

	for(int i=0;i<requests.size();i++){
		int exclude = requests[i].first;
		for(int j=now;j<exclude;j++){
			printf("%d\n", j);
		}
		now = exclude+1;
	}
	for(int j=now;j<n;j++){
		printf("%d\n", j);
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   33 |         std::sort(requests.begin(), requests.end(), mycomp1);
      |              ^~~~
      |              qsort
a.cc:40:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   40 |         std::sort(requests.begin(), requests.end(), mycomp2);
      |              ^~~~
      |              qsort
Language: C++

#include <vector>
#include <cstdio>
int main(){
	scanf("%d",&n,&k);
	std::vector<int>v(n+1),w(k);
	for(int i=0;i<k;i++)scanf("%d",&w[k]);
	for(int i=k-1;i>=0;i--)if(!v[w[k]])v[w[k]]=1,printf("%d\n",w[k]);
	for(int i=1;i<=n;i++)if(!v[i])printf("%d\n",i);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:21: error: 'n' was not declared in this scope
    4 |         scanf("%d",&n,&k);
      |                     ^
a.cc:4:24: error: 'k' was not declared in this scope
    4 |         scanf("%d",&n,&k);
      |                        ^
Language: C++

#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, m; cin >> n >> m;
    vi a(m); for(auto& e : a) cin >> e, e--;
    vi used(n);

    reverse(_all(a));
    for(auto& e : a){
        if(used[e]) continue;
        cout << e + 1 << endl;
        used[e] = true;
    }

    rep(i, n){
        if(used[e]) continue;
        cout << e + 1 << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:17: error: 'e' was not declared in this scope
   69 |         if(used[e]) continue;
      |                 ^
a.cc:70:17: error: 'e' was not declared in this scope
   70 |         cout << e + 1 << endl;
      |                 ^
Language: C

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

int a[10][10], b[5];
int cale() {
	int i = a[0][b[4]];
	for (int k = 3; k >= 1; k--)
		i = a[i][b[k]];
	return i;
}
int cal() {
	return a[cale()][b[0]];
}
bool detected(int x) {
	for (int i = 1; i < 5; i++) {
		b[i] = x % 10;
		x /= 10;
	}
	b[0] = cale();
	for (int i = 0; i < 4; i++) {
		if (b[i] != b[i + 1]) {
			swap(b[i], b[i + 1]);
			if (cal() == 0)
				return false;
			swap(b[i], b[i + 1]);
		}
	}
	for (int i = 0; i < 5; i++) {
		int tmp = b[i];
		for (int j = 0; j < 10; j++) {
			if (j == tmp) continue;
			b[i] = j;
			if (cal() == 0)
				return false;
		}
		b[i] = tmp;
	}
	return true;
}
int main(void) {
	for (int i = 0; i < 10; i++)
		for (int j = 0; j < 10; j++)
			scanf("%d", &a[i][j]);
	int sum = 0;
	for (int i = 0; i < 10000; i++)
		if (!detected(i))
			sum++;
	printf("%d\n", sum);
}


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

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<stack>
#define inf 0x3f3f3f3f
#define esp 1e-7
using namespace std;
int read(){
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}

int r[11][11];

void divide(int num,int &a,int &b,int &c,int &d){
	a=num/1000;
	b=(num%1000)/100;
	c=(num%100)/10;
	d=num%10;
}


int main(){
	for (int i=0;i<10;i++){
		for (int j=0;j<10;j++){
			r[i][j]=read();
		}
	}
	int ans=0;
	for (int i=0;i<=9999;i++){
		int tmp,a,b,c,d;
		divide(i,a,b,c,d);
		tmp=r[r[r[r[0][a]][b]][c]][d];
		if ((a!=b&&tmp==r[r[r[r[0][b]][a]][c]][d])
		  ||(b!=c&&tmp==r[r[r[r[0][a]][c]][b]][d])
		  ||(c!=d&&tmp==r[r[r[r[0][a]][b]][d]][c])
		  ||(d!=tmp&&d==r[r[r[r[0][a]][b]][c]][tmp]))
		ans++;
		else{
			for (int j=0;j<=9;j++){
				if 		(j!=a&&tmp==r[r[r[r[0][j]][b]][c]][d]) {ans++;break;}
				else if (j!=b&&tmp==r[r[r[r[0][a]][j]][c]][d]) {ans++;break;}
				else if (j!=c&&tmp==r[r[r[r[0][a]][b]][j]][d]) {ans++;break;}
				else if (j!=d&&tmp==r[r[r[r[0][a]][b]][c]][j]) {ans++;break;}
				else if (j!=tmp&&j==r[r[r[r[0][a]][b]][c]][d]) {ans++;break;}
			}
		}
	}
	printf("%d\n",ans);
	return 0;
}

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

#include<bits/stdc++.h>
#define pb push_back
using namespace std;
typedef long long ll;
int a[11][11];
int check(int i,int b,int c,int d,int e)
{
	int temp;
	temp=a[0][i];
	temp=a[temp][b];
	temp=a[temp][c];
	temp=a[temp][d];
	temp=a[temp][e];
	return temp;
}
int vm(int i,int b,int c,int d)
{
	int temp;
	temp=a[0][i];
	temp=a[temp][b];
	temp=a[temp][c];
	temp=a[temp][d];
	return temp;
}
int main(void)
{
	int e[10001];
	ll ans=0;
	ll x=0;
	for(int i=0;i<10;i++)
		for(int j=0;j<10;j++)
		{
			scanf("%d",&a[i][j]);
		}
	for(int i=0;i<10;i++)
		for(int j=0;j<10;j++)
			for(int k=0;k<10;k++)
				for(int q=0;q<10;q++)
				{
					e[i*1000+j*100+k*10+q]=vm(i,j,k,q);
				}
	for(int i=0;i<10;i++)
		for(int j=0;j<10;j++)
		{
			for(int k=0;k<10;k++)
				{
					for(int q=0;q<10;q++)
					{
						for(int p=0;p<10;p++)
						{
						int temp=check(i,j,k,q,p);
						if(temp==check(i,j,k,q,e[i*1000+j*100+k*10+q]))
						{
						ans++;
						}
						}
						ans--;
					}
				}
		}
			
	printf("%d\n",ans);
	return 0;
}

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

#include <iostream>
#include <cstring>
#include <string>
#include <set>
#include <cstdio>
#include <algorithm>

using namespace std;
set<int> F;
set<int> G;
char D[1000000][5];
int main()
{   int A[12][12];
     memset(A,0,sizeof(A));
     for(int r=0;r<=9;r++)
        for(int c=0;c<=9;c++)
     {
         scanf("%d",&A[r][c]);
     }
     memset(D,0,sizeof(D));
     int h;
     int i=0;
     memset(D,0,sizeof(D));
     for(int f=0;f<=9;f++)
        for(int s=0;s<=9;s++)
         for(int t=0;t<=9;t++)
           for(int fo=0;fo<=9;fo++)
     {
            int d=A[0][f];
                d=A[d][s];
                d=A[d][t];
                d=A[d][fo];
              D[i][0]=f;
              D[i][1]=s;
              D[i][2]=t;
              D[i][3]=fo;
              D[i][4]=d;
             i++;
     }
     int num=0;
   //  cout<<i<<"DDDDDDD";
     int f;
      int found=0;
     for(int ic=0;ic<i;ic++)
     {    found=0;
     // cout<<ic<<' '<<i<<"DDDDDDDDDDD";
      for(int g=0;g<=9;g++)
          {    if(found)
                break;
              for(int h=0;h<=4;h++)
          {   //  cout<<ic<<"DDDDDD";
               f=D[ic][h];
              int p=0;
              if(g==f)
                continue;
                 D[ic][h]=g;
                int d=0;
                int fd=0;
              for(int k=0;k<=4;k++)
              {
                  d=A[d][D[ic][k]];

              }

              if(d==0)
                {num++;
                found=1;
                 D[ic][h]=f;
                break;}
              D[ic][h]=f;}
              for(int g=0;g<=4;g++)
            {    if(found)
                  break;
                for(int y=g+1;y<=4;y++)
         {       int h=D[ic][g];
                int k=D[ic][y];
                D[ic][g]=k;
                D[ic][y]=h;
                int d=0;
                int fd=0;
                 for(int k=0;k<=4;k++)
              {
                  d=A[d][D[ic][k]];

              }
              if(d==0)
                {num++;
                found=1;
                D[ic][g]=k;
                D[ic][y]=h;
                 break;}
                 if(found)
                    break;
         }
         if(found)
            break;
         }


          if(found)
            break;
          }

     }
     cout<<num<<endl;

    return 0;
}

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

#include<stdio.h>
int main()
{
  int mat[SIZE][SIZE];
  int i,j;
  int fault=0;
  int a,b,c,d,e;
  int result=0;
  for(i=0;i<10;i++)
    {
      for(j=0;j<10;j++)
	{
	  scanf("%d",&mat[i][j]);
	}
    }

  for(a=0;a<10;a++)
    {
      for(b=0;b<10;b++)
	{
	  for(c=0;c<10;c++)
	    {
	      for(d=0;d<10;d++)
		{
		  fault=0;
		  e=mat[mat[mat[a][b]][c]][d];
		  if(fault==0)
		    {
		      for(i=0;i<10;i++)
			{
			  if(i==a) continue;
			  if(mat[mat[mat[i][b]][c]][d]==e)
			    {
			      fault++;
			      break;
			    }
			}
		    }
		  if(fault==0)
		    {
		      for(i=0;i<10;i++)
			{
			  if(i==b) continue;
			  if(mat[mat[mat[a][i]][c]][d]==e)
			    {
			      fault++;
			      break;
			    }
			}
		    }		  
		  if(fault==0)
		    {
		      for(i=0;i<10;i++)
			{
			  if(i==c) continue;
			  if(mat[mat[mat[a][b]][i]][d]==e)
			    {
			      fault++;
			      break;
			    }
			}
		    }
		  if(fault==0)
		    {
		      for(i=0;i<10;i++)
			{
			  if(i==d) continue;
			  if(mat[mat[mat[a][b]][c]][i]==e)
			    {
			      fault++;
			      break;
			    }
			}
		    }
		  if(fault==0)
		    {
		      if((mat[mat[mat[b][a]][c]][d]==e)||(mat[mat[mat[a][c]][b]][d]==e)||(mat[mat[mat[a][b]][d]][c]==e)||(mat[mat[mat[a][b]][c]][e]==d))
			{
			  fault++;
			  break;
			}
		    }
		  if(fault) result++;		  
		}
	    }
	}
    }
  printf("%d\n",result);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:11: error: 'SIZE' undeclared (first use in this function)
    4 |   int mat[SIZE][SIZE];
      |           ^~~~
main.c:4:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <string>
#include <set>
#include <cstdio>
using namespace std;
const int M=4;
int m[10][10];
char s0[M+1];
int chk(const string &s){
	int d=0;
	for(int i=0;i<4;i++)d=m[d][s[i]-'0'];
	return d;
}
bool correct(const string &s){
	return chk(s)+'0'==s[M];
}
int main(){
	set<string>se;
	for(int i=0;i<10;i++)for(int j=0;j<10;j++)scanf("%d",m[i]+j);
	for(int i=0;i<10000;i++){
		sprintf(s0,"%04d",i);
		string s=s0;
		s+=chk(s)+'0';
		se.insert(s);
	}
	printf("%d\n",count_if(se.begin(),se.end(),[&](string s)->bool{
		for(int i=0;i<M;i++)if(s[i]!=s[i+1]){
			swap(s[i],s[i+1]);
			if(correct(s)&&se.find(s)!=se.end())return true;
			swap(s[i],s[i+1]);
		}
		for(int i=0;i<=M;i++)for(int j='0';j<='9';j++)if(s[i]!=j){
			string t=s;
			t[i]=j;
			if(correct(t)&&se.find(t)!=se.end())return true;
		}
		return false;
	}));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: 'count_if' was not declared in this scope
   25 |         printf("%d\n",count_if(se.begin(),se.end(),[&](string s)->bool{
      |                       ^~~~~~~~
Language: C++

#include <string>
#include <set>
#include <cstdio>
#include <algorithm>
using namespace std;
const int M=4;
int m[10][10];
char s0[M+2];
int chk(const string &s){
	int d=0;
	for(int i=0;i<4;i++)d=m[d][s[i]-'0'];
	return d;
}
bool correct(const string &s){
	return d[chk(s)][s[M]-'0']==0;
}
int main(){
	set<string>se;
	for(int i=0;i<10;i++)for(int j=0;j<10;j++)scanf("%d",m[i]+j);
	for(int i=0;i<10000;i++){
		sprintf(s0,"%04d",i);
		string s=s0;
		s+=chk(s)+'0';
		se.insert(s);
	}
	printf("%d\n",count_if(se.begin(),se.end(),[&](string s)->bool{
		for(int i=0;i<M;i++)if(s[i]!=s[i+1]){
			swap(s[i],s[i+1]);
			if(correct(s))return true;
			swap(s[i],s[i+1]);
		}
		for(int i=0;i<=M;i++)for(int j='0';j<='9';j++)if(s[i]!=j){
			string t=s;
			t[i]=j;
			if(correct(t))return true;
		}
		return false;
	}));
}

Compiler output:
a.cc: In function 'bool correct(const std::string&)':
a.cc:15:16: error: 'd' was not declared in this scope
   15 |         return d[chk(s)][s[M]-'0']==0;
      |                ^
Language: C++

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

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<(o)<<" ";}
#define dumpl(o) if(DBG){cerr<<#o<<" "<<(o)<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

//0??????
void fill(string& s, int length, char c = '0') {
	string prefix = "";
	for (int i = s.size(); i < length; i++)prefix += c;
	s = prefix + s;
}

int table[10][10];
char e(string &s) {
	int ret = 0;
	rep(i, 0, 4) {
		ret = table[ret][s[i] - '0'];
	}
	return (char)(ret + '0');
}

int check(string &s) {
	return table[e(s.substr(0, 4)) - '0'][s[4] - '0'];
}

signed main() {
	rep(i, 0, 10)rep(j, 0, 10)cin >> table[i][j];
	int ans = 0;
	rep(x, 0, 10000) {
		string abcd = to_string(x);
		fill(abcd, 4);
		string abcde = abcd + e(abcd);
		bool flag = false;
		rep(i, 0, 5) {
			rep(c, 0, 10) {
				if (c == abcde[i] - '0')continue;
				string tmp = abcde;
				tmp[i] = c + '0';
				if (check(tmp) == 0) {
					bool flag = true;
					i = INF;
					break;
				}
			}
		}
		if (flag) {
			ans++;
			continue;
		}
		rep(i, 1, 5) {
			string tmp = abcde;
			swap(tmp[i], tmp[i - 1]);
			if (tmp == abcde)continue;
			if (check(tmp) == 0) {
				flag = true;
				ans++;
				break;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int check(std::string&)':
a.cc:34:32: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   34 |         return table[e(s.substr(0, 4)) - '0'][s[4] - '0'];
      |                        ~~~~~~~~^~~~~~
a.cc:25:16: note:   initializing argument 1 of 'char e(std::string&)'
   25 | char e(string &s) {
      |        ~~~~~~~~^
Language: C++

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

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<(o)<<" ";}
#define dumpl(o) if(DBG){cerr<<#o<<" "<<(o)<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

//0??????
void fill(string& s, int length, char c = '0') {
	string prefix = "";
	for (int i = s.size(); i < length; i++)prefix += c;
	s = prefix + s;
}

int table[10][10];
char e(string &s) {
	int ret = 0;
	rep(i, 0, 4) {
		ret = table[ret][s[i] - '0'];
	}
	return (char)(ret + '0');
}

int check(const string &s) {
	return table[e(s.substr(0, 4)) - '0'][s[4] - '0'];
}

signed main() {
	rep(i, 0, 10)rep(j, 0, 10)cin >> table[i][j];
	int ans = 0;
	rep(x, 0, 10000) {
		string abcd = to_string(x);
		fill(abcd, 4);
		string abcde = abcd + e(abcd);
		bool flag = false;
		rep(i, 0, 5) {
			rep(c, 0, 10) {
				if (c == abcde[i] - '0')continue;
				string tmp = abcde;
				tmp[i] = c + '0';
				if (check(tmp) == 0) {
					bool flag = true;
					i = INF;
					break;
				}
			}
		}
		if (flag) {
			ans++;
			continue;
		}
		rep(i, 1, 5) {
			string tmp = abcde;
			swap(tmp[i], tmp[i - 1]);
			if (tmp == abcde)continue;
			if (check(tmp) == 0) {
				flag = true;
				ans++;
				break;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int check(const std::string&)':
a.cc:34:32: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   34 |         return table[e(s.substr(0, 4)) - '0'][s[4] - '0'];
      |                        ~~~~~~~~^~~~~~
a.cc:25:16: note:   initializing argument 1 of 'char e(std::string&)'
   25 | char e(string &s) {
      |        ~~~~~~~~^
Language: C++

#include<cstdio>
#include<iostream>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
#include<cmath>
#include<algorithm>
#include<map>
#include<cstdlib>
#include<stack>
#include<sstream>
#include<string>
#include<cassert>
#include<ctime>
#include<functional>
#include<deque>
#include<bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
int kase = 0;
int n, m;
const int maxn = 5500;
//string s[maxn];
vector<string> s[maxn];
string line;
string st;
int maxlen[maxn] = { 0 };
int cnt[maxn] = { 0 };

int main()
{
	//cin.tie(0);
	//ios::sync_with_stdio(false);
	n = 0;
	while (getline(cin, line))
	{
	//	if(line.empty()) continue;
		stringstream ss(line);
	//	memset(cnt, 0, sizeof(cnt));1
		cnt[n] = 0;
		//int col = 0;
		while (ss >> st)
		{
			maxlen[col] = max(maxlen[col], (int)st.size());
			//for (int j = 0; j < str.size(); j++)
				//s[n][j] = str[j];
			cnt[n]++;
			//col++;
			s[n].push_back(st);
		}
	//	line.clear();
		n++;
	}	
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < s[i].size() - 1; j++)
		{
			int siz = maxlen[j];
			int tmp = (int)s[i][j].length();
			cout << s[i][j];
			//printf("%-.5s", s[i][j].c_str());
		  //printf("%-ds", size , s[i][j].c_str());
			while (tmp <= siz)
			{
				//printf(" ");
				cout << ' ';
				tmp++;
			}
			//printf(" ");
		//	cout << " ";
		}
		cout << s[i][s[i].size() - 1] << endl;
	}
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:48:32: error: 'col' was not declared in this scope; did you mean 'cosl'?
   48 |                         maxlen[col] = max(maxlen[col], (int)st.size());
      |                                ^~~
      |                                cosl
Language: Java

// http://icpc.iisf.or.jp/past-icpc/regional2016/problems.pdf
// problem C

// ng: 15-34
import java.util.*;

public class C {
  public static void main(String[] args) {
    // int n = 4;
    // int arms[] = {1, 3, 2};

    Scanner scan = new Scanner(System.in);
    String line = scan.nextLine();
    int n = Integer.parseInt(line.split(" ")[0]);
    int m = Integer.parseInt(line.split(" ")[1]);

    // int arms[] = new int[m];
    Map<Integer, Integer> map = new TreeMap<Integer, Integer>();
    for (int i = 0; i < m; i++) {
      line = scan.nextLine();
      int x = Integer.parseInt(line.split(" ")[0]);
      int y = Integer.parseInt(line.split(" ")[1]);

      map.put(x, y);
    }

    Integer arms[] = map.values().toArray(new Integer[m]);
    // System.out.println(map.values());
    //
    // System.exit(0);

    // for (int arm: arms) {
    //   System.out.println(arm);
    // }



    int nums[] = new int[n + 1];
    boolean visited[] = new boolean[n + 1];
    for (int i = 1; i <= n; i++) {
      nums[i] = 1;
      visited[i] = false;
    }

    for (int arm: arms) {
      // System.out.println(arm + " " + visited[arm]);
      if (!visited[arm]) {
        int i = nums[arm + 1];
        int j = nums[arm];
        nums[arm] += i;
        nums[arm + 1] += j;
        visited[arm] = true;
      } else {
        int i = nums[arm + 1];
        int j = nums[arm];

        nums[arm] = Math.max(i, j);
        nums[arm + 1] = Math.max(i, j);
      }
    }

    for (int i = 1; i <= n; i++) {
      if (i > 1) System.out.print(" ");
      System.out.print(nums[i]);
    }
    System.out.println();
  }
}

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

//61511457
import java.util.*;
public class C {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    String str = scan.nextLine();
    String[] div = str.split(" ", 0);
    int n = Integer.parseInt(div[0]);
    int m = Integer.parseInt(div[1]);
    boolean[][] map = new boolean[n][n];
    HashMap<Integer,Integer> hm = new HashMap<Integer,Integer>();
    PriorityQueue<Integer> pq = new PriorityQueue<Integer>();
    for(int i = 0; i < n; i++) {
      map[i][i] = true;
    }
    for(int i = 0; i < m; i++) {
      scan = new Scanner(System.in);
      str = scan.nextLine();
      div = str.split(" ", 0);
      int x = Integer.parseInt(div[0]);
      int y = Integer.parseInt(div[1]);
      hm.put(x,y);
      pq.add(x);
    }
    for(int i = 0; i < m; i++) {
      int x = pq.poll();
      int y = hm.get(x);
      //System.out.println(x + " " + y);
      y--;
      for(int j = 0; j < n; j++) {
        map[y][j] = map[y][j] || map[y+1][j];
        map[y+1][j] = map[y][j];
      }
    }
    /*
    for(int i = 0; i < n; i++) {
      for(int j = 0; j < n; j++) {
        System.out.print(map[i][j]);
      }
      System.out.println();
    }
    */

    for(int i = 0; i < n; i++) {
      int cnt = 0;
      for(int j = 0; j < n; j++) {
        if(map[i][j] == true) {
          cnt++;
        }
      }
      System.out.print(cnt + " ");
    }
    System.out.println();
  }
}

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

//61511457
import java.util.*;
public class 1369 {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    String str = scan.nextLine();
    String[] div = str.split(" ", 0);
    int n = Integer.parseInt(div[0]);
    int m = Integer.parseInt(div[1]);
    boolean[][] map = new boolean[n][n];
    HashMap<Integer,Integer> hm = new HashMap<Integer,Integer>();
    PriorityQueue<Integer> pq = new PriorityQueue<Integer>();
    for(int i = 0; i < n; i++) {
      map[i][i] = true;
    }
    for(int i = 0; i < m; i++) {
      scan = new Scanner(System.in);
      str = scan.nextLine();
      div = str.split(" ", 0);
      int x = Integer.parseInt(div[0]);
      int y = Integer.parseInt(div[1]);
      hm.put(x,y);
      pq.add(x);
    }
    for(int i = 0; i < m; i++) {
      int x = pq.poll();
      int y = hm.get(x);
      //System.out.println(x + " " + y);
      y--;
      for(int j = 0; j < n; j++) {
        map[y][j] = map[y][j] || map[y+1][j];
        map[y+1][j] = map[y][j];
      }
    }
    /*
    for(int i = 0; i < n; i++) {
      for(int j = 0; j < n; j++) {
        System.out.print(map[i][j]);
      }
      System.out.println();
    }
    */

    for(int i = 0; i < n; i++) {
      int cnt = 0;
      for(int j = 0; j < n; j++) {
        if(map[i][j] == true) {
          cnt++;
        }
      }
      System.out.print(cnt + " ");
    }
    System.out.println();
  }
}

Compiler output:
Main.java:3: error: <identifier> expected
public class 1369 {
            ^
1 error
Language: C

#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
using namespace std;
int main(){
	cout<<1<<endl;
	return 0;
}

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

#include <iostream>
#include <vector>

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

using namespace std;

int n, m;

int main(){
    cin >> n >> m;
    int cnt[200100] = {};
    vector<pair<int,int> > vp;
    bool f[200100] = {};
    fill(cnt,cnt+n,1);
    rep(i,m){
        int x, y;
        cin >> x >> y;
        vp.push_back(pair<int,int>(x,y));
    }
    sort(vp.begin(),vp.end());
    rep(i,vp.size()){
        if(!f[i]){
            f[i] = 1;
            int u = vp[i].second-1;
            int sum = cnt[u]+cnt[u+1];
            cnt[u] = sum;
            cnt[u+1] = sum;
        }
    }
    rep(i,n){
        cout << cnt[i];
        if(i!=n-1)cout<<" ";
        else cout<<endl;
    }
}


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

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

int low[200001], hi[200001];

int main() {
  int n, m;
  cin >> n >> m;

  for (int i = 0; i < n; ++i) {
    low[i] = hi[i] = i;
  }

  std::vector<std::pair<int, int>> arm;
  for (int i = 0; i < m; ++i) {
    int x, y;
    cin >> x >> y;
    arm.push_back(make_pair(x, n - 1 - y));
  }
  sort(arm.begin(), arm.end());

  for (int i = 0; i < m; ++i) {
    int y = arm[i].second;
    // cout << "swap " << y << " " << low[y] << " " << hi[y] << ", " <<
    //     low[y+1] << " " << hi[y+1];
    low[y + 1] = low[y];
    hi[y] = hi[y + 1];
    // cout << " -> " << low[y] << " " << hi[y] << ", " << low[y+1] << " " << hi[y+1] <<endl;
  }

  for (int i = n - 1; i >= 0; --i) cout << hi[i] - low[i] + 1 << " ";
  cout << endl;

  return 0;
}

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