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

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#define pb push_back
#define pii pair<int,int>
using namespace std;

int n,m,num,ima;
vector<vector<int> > g;
vector<int> vis;
vector<int> res,tmp;
vector<pii> p;
void dfs(int doko){
  int i;
  //cout<<doko<<" ";
  tmp.pb(doko);
  vis[doko]=1;
  for(i=0;i<g[ima].size();i++){
    if(doko==g[ima][i]){
      num--;
      break;
    }
  }
  //cout<<"("<<doko<<" "<<num<<")";
  if(num==0){
    copy(tmp.begin(),tmp.end(),back_inserter(res));
    return;
  }
  for(i=0;i<g[doko].size();i++){
    if(vis[g[doko][i]]==0) dfs(g[doko][i]);
    if(num==0) return;
  }
  tmp.pop_back();
  vis[doko]=0;
  for(i=0;i<g[ima].size();i++){
    if(doko==g[ima][i]){
      num++;
      break;
    }
  }
}

int main(void){
  cin>>n>>m;
  int x,y,i;
  vis.resize(n+1);
  for(i=0;i<=n;i++){
    vector<int> b;
    g.pb(b);
    vis[i]=0;
  }
  for(i=0;i<m;i++){
    cin>>x>>y;
    g[x].pb(y);
    g[y].pb(x);
  }
  for(i=1;i<=n;i++){
    p.pb(pii(g[i].size(),i));
  }
  sort(p.begin(),p.end());
  for(i=0;i<n;i++){
    num=g[p[i].second].size();
    ima=p[i].second;
    for(j=0;j<=n;j++){
      vis[j]=0;
    }
    dfs(p[i].second);
    //cout<<endl;
    if(res.size()>0) break;
  }
  
  cout<<res.size()<<endl;
  for(i=0;i<res.size();i++){
    cout<<res[i];
    if(i==res.size()-1)cout<<endl;
    else cout<<" ";
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:9: error: 'j' was not declared in this scope
   66 |     for(j=0;j<=n;j++){
      |         ^
Language: C++

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

const int MAXN=1e5+10;
vector<int> v[MAXN];
int vis[MAXN], path[MAXN], tag[MAXN], ans=0, e=0;

void dfs(int x){
    e=x;
    vis[x]=1;
    for(int i=0; i<v[x].size(); i++){
        int p=v[x][i];
        if(!vis[p]){
            dfs(p);
            path[x]=p;
            ans++;
        }
    }
}

int main(void){
    int n, m;
    cin >> n >> m;
    while(m--){
        int x, y;
        cin >> x >> y;
        v[x].push_back(y);
        v[y].push_back(x);
    }
    for(int i=1; i<=n; i++){
        ans=0;
        memset(path, 0, sizeof(path));
        memset(vis, 0, sizeof(vis));
        memset(tag, 0, sizeof(tag));
        dfs(i);
        int gg=i;
        while(gg){
            tag[gg]=1;
            gg=path[gg];
        }
        bool flag1=true, flag2=true;
        for(int j=0; j<v[i].size(); j++){
            if(!tag[v[i][j]]){
                flag=false;
                break;
            }
        }
        for(int j=0; j<v[e].size(); j++){
            if(!tag[v[e][j]]){
                flag=false;
                break;
            }
        }
        if(ans>=2&&(flag1||flag2)){
            int cc=i;
            cout << ans+1 << endl;
            while(cc){
                cout << cc << " ";
                cc=path[cc];
            }
            cout << endl;
            return 0;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:17: error: 'flag' was not declared in this scope; did you mean 'flag2'?
   46 |                 flag=false;
      |                 ^~~~
      |                 flag2
a.cc:52:17: error: 'flag' was not declared in this scope; did you mean 'flag2'?
   52 |                 flag=false;
      |                 ^~~~
      |                 flag2
Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

int main()
{
  int N,M;
  cin >> N >> M;
  int a;
  for(int i=0; i < 2*M)
    cin >> a;
  cout << 1 << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: expected ';' before ')' token
   15 |   for(int i=0; i < 2*M)
      |                       ^
      |                       ;
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int N, M;
bool Use[100005];
vector <int> G[100005];
int Father[100005];
int leaf;
int Level[100005];
vector <int> Leaf;
vector <int> Sol, Sol2;
void Read()
{
    cin >> N >> M;
    for(int i = 1; i <= M; i++)
    {
        int x, y;
        cin >> x >> y;
        G[x].push_back(y);
        G[y].push_back(x);
    }

}

void DFS(int node, int father)
{
    Use[node] = 1;
    int cnt = 0;
    Father[node] = father;
    Level[node] = Level[father] + 1;
    for(int i = 0; i < G[node].size(); i++)
    {
        int neighb = G[node][i];
        if(Use[neighb] == 1)
            continue;
        ++cnt;
        DFS(neighb, node);
    }
    if(cnt == 0)
        Leaf.push_back(node);
}

void Print()
{
    int node1 = Leaf[0];
    while(node1 != 1)
    {
        Sol.push_back(node1);
        node1 = Father[node1];
    }
    Sol.push_back(1);
    if(Leaf.size() > 1)
    {
        int node2 = Leaf[1];
        while(node2 != 1)
    {
        Sol2.push_back(node2);
        node2 = Father[node2];
    }
    }

    cout << Sol.size() + Sol2.size() << "\n";
    reverse(Sol2.begin(), Sol2.end());
    for(int i = 0; i < Sol.size(); i++)
        cout << Sol[i] << " ";
     for(int i = 0; i < Sol2.size(); i++)
        cout << Sol2[i] << " ";
}
int main()
{
    Read();
    DFS(1, 0);
    Print();
    return 0;
}


Compiler output:
a.cc: In function 'void Print()':
a.cc:63:5: error: 'reverse' was not declared in this scope
   63 |     reverse(Sol2.begin(), Sol2.end());
      |     ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
const int maxn = 100010;
const int inf = 0x0fffffff;
#define LL long long
const long long mod = 1000000007;

vector <int> edge[maxn];
bool vis[maxn];


bool dfs(int v, vector<int> &path)
{
	vis[v] = true;
	path.push_back(v);
	for (int i = 0; i < edge[v].size(); i ++)
		if (!vis[edge[v][i]])
		{
			return dfs(edge[v][i], path);
		}
	return true;
}

int main()
{
	int n, i, m, v, w;
	vector<int> path1, path2;
	path1.clear();
	path2.clear();
	cin >> n >> m;
	for (i = 0; i < m; i ++)
	{
		cin >> v >> w;
		edge[v].push_back(w);
		edge[w].push_back(v);
	}
	memset(vis, false, sizeof(vis));
	for (v = 1; v <= n; v ++)
		if (edge[v].size() > 0)
		{
			dfs(v, path1);
			for (int i = 0; i < edge[v].size(); i ++)
				if (!vis[edge[v][i]])
					dfs(edge[v][i], path2);
			break;
		}
	cout << path1.size() + path2.size() << endl;
	for (i = path2.size() - 1; i >= 0; i --)
			cout << path2[i] << " ";

	for (i = 0; i < path1.size(); i ++)
			cout << path1[i] << " ";
	return 0;
}

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

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

int N,M;
int mat[100000][100000] = {0};
vector<int> ans;
int visited[100000] = {0};

void DFS(int v)
{
	ans.push_back(v+1);
	visited[v] = 1;
	for(int i=0;i<N;i++){
		if(mat[v][i]==1 && visited[i]==0){
			DFS(i);
			return;
		}
	}
	return;
}

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

	for(int i=0;i<M;i++){
		int a,b;
		cin >> a >> b;
		a--; b--;
		mat[a][b] = mat[b][a] = 1;
	}
	DFS(0);
	cout << ans.size() << endl;
	for(int i=0;i<ans.size();i++){
		cout << ans[i] << " ";
	}
	cout << endl;
	return 0;
}

Compiler output:
/tmp/ccv4BT3Y.o: in function `DFS(int)':
a.cc:(.text+0x1e): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccv4BT3Y.o
a.cc:(.text+0x3a): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccv4BT3Y.o
a.cc:(.text+0x8a): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccv4BT3Y.o
/tmp/ccv4BT3Y.o: in function `main':
a.cc:(.text+0x1c5): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccv4BT3Y.o
a.cc:(.text+0x209): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccv4BT3Y.o
a.cc:(.text+0x24a): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccv4BT3Y.o
/tmp/ccv4BT3Y.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x28b): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccv4BT3Y.o
a.cc:(.text+0x2a4): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccv4BT3Y.o
collect2: error: ld returned 1 exit status
Language: C++

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

int n,m,a,b;
vector<int> v[100010];

bool vis[100010];
stack<int> st,cop;

bool DFS(int x,int find,int not){
	vis[x]=1,st.push(x);
	if(x==find)return true;

	for(int i=0;i<v[x].size();i++){
		if(!vis[v[x][i]]&&v[x][i]!=not){
			if(DFS(v[x][i],find,not)){
				return true;
			}
		}
	}
	vis[x]=0,st.pop();
	return false;
}

int main(){
	cin>>n>>m;
	for(int i=0;i<m;i++){
		cin>>a>>b;a--,b--;
		v[a].push_back(b);
		v[b].push_back(a);
	}
	vector<int> tan;
	vector<pair<int,int> >pir,mem;

	for(int i=0;i<n;i++){
		if(v[i].size()==1)tan.push_back(i);
		if(v[i].size()==2){
			if(v[v[i][0]].size()==2){
				int r=v[v[i][0]][0];
				if(r==i)r=v[v[i][0]][1];
				pir.push_back(make_pair(v[i][1],r));
				mem.push_back(make_pair(i,v[i][0]));
			}
			if(v[v[i][1]].size()==2){
				int r=v[v[i][1]][0];
				if(r==i)r=v[v[i][1]][1];
				pir.push_back(make_pair(v[i][0],r));
				mem.push_back(make_pair(i,v[i][1]));
			}
		}
	}
	for(int i=0;i<tan.size();i++){
		for(int j=i+1;j<tan.size();j++){
			pir.push_back(make_pair(tan[i],tan[j]));
			mem.push_back(make_pair(-1,-1));
		}
	}

	for(int i=0;i<pir.size();i++){
		//cout<<"#"<<i<<" "<<pir[i].first<<" "<<pir[i].second<<endl;
		if(mem[i].first>-1)st.push(mem[i].first);
		if(DFS(pir[i].first,pir[i].second,pir[i].first)){
			if(mem[i].second>-1)st.push(mem[i].second);
			break;
		}
		while(!st.empty())st.pop();
	}

	while(!st.empty())cop.push(st.top()),st.pop();
	bool f=0;
	cout<<cop.size()<<endl;
	while(!cop.empty()){
		if(f)cout<<" ";
		cout<<cop.top()+1;
		cop.pop();
		f=1;
	}
	cout<<endl;
	return 0;
}

Compiler output:
a.cc:13:29: error: expected ',' or '...' before 'not' token
   13 | bool DFS(int x,int find,int not){
      |                             ^~~
a.cc: In function 'bool DFS(int, int, int)':
a.cc:18:47: error: expected primary-expression before ')' token
   18 |                 if(!vis[v[x][i]]&&v[x][i]!=not){
      |                                               ^
a.cc:19:48: error: expected primary-expression before ')' token
   19 |                         if(DFS(v[x][i],find,not)){
      |                                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define s second 
#define f first
#define mk make_pair
bool a[100001][100001],used[100001];
int n,m;
 main(){
	cin>>n>>m;
	r(i,m){
		int p1,p2;
		cin>>p1>>p2;
		a[p1][p2]=a[p2][p1]=1;
	}
	queue<int>l;
	queue<int>q;
	r(j,n){r(i,n+1)used[i]=0;
	used[j+1]=1;
	q.push(j+1);
	int b[n+1]={0},p,bb[n+1]={0};
	r(i,n)if(a[i+1][j+1])b[i+1]=1;
	while(!q.empty()){
		p=q.front();q.pop();
		l.push(p);
		r(i,n){
			if(a[p][i+1]){
				if(!used[i+1]){
					used[i+1]=1;
					q.push(i+1);goto L;
				}
			}
		}L:;
	}
	int ccc=0;
	r(i,n)if(a[i+1][p])bb[i+1]=1;
	r(i,n)if(b[i+1]||bb[i+1]){
		if(!used[i+1])ccc++;
	}
	if(!ccc)goto PP;
	while(!q.empty())q.pop();
	while(!l.empty())l.pop();
    }PP:;
	cout<<l.size()<<endl;int cc=0;
	while(!l.empty()){
		if(cc)cout<<' ';
		cout<<l.front();l.pop();
		cc++;
	}
}

Compiler output:
a.cc:9:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    9 |  main(){
      |  ^~~~
/tmp/cckV7qmJ.o: in function `main':
a.cc:(.text+0xf): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cckV7qmJ.o
a.cc:(.text+0x2b): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cckV7qmJ.o
a.cc:(.text+0xe7): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cckV7qmJ.o
a.cc:(.text+0x135): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/cckV7qmJ.o
a.cc:(.text+0x143): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cckV7qmJ.o
a.cc:(.text+0x157): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/cckV7qmJ.o
a.cc:(.text+0x180): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cckV7qmJ.o
a.cc:(.text+0x200): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cckV7qmJ.o
a.cc:(.text+0x2cd): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cckV7qmJ.o
a.cc:(.text+0x35a): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/cckV7qmJ.o
a.cc:(.text+0x374): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define s second 
#define f first
#define mk make_pair
int a[100001][100001],used[100001];
int n,m;
 main(){
	cin>>n>>m;
	r(i,m){
		int p1,p2;
		cin>>p1>>p2;
		a[p1][p2]=a[p2][p1]=1;
	}
	queue<int>l;
	queue<int>q;
	r(j,n){r(i,n+1)used[i]=0;
	used[j+1]=1;
	q.push(j+1);
	int b[n+1]={0},p,bb[n+1]={0};
	r(i,n)if(a[i+1][j+1])b[i+1]=1;
	while(!q.empty()){
		p=q.front();q.pop();
		l.push(p);
		r(i,n){
			if(a[p][i+1]){
				if(!used[i+1]){
					used[i+1]=1;
					q.push(i+1);goto L;
				}
			}
		}L:;
	}
	int ccc=0;
	r(i,n)if(a[i+1][p])bb[i+1]=1;
	r(i,n)if(b[i+1]||bb[i+1]){
		if(!used[i+1])ccc++;
	}
	if(!ccc)goto PP;
	while(!q.empty())q.pop();
	while(!l.empty())l.pop();
    }PP:;
	cout<<l.size()<<endl;int cc=0;
	while(!l.empty()){
		if(cc)cout<<' ';
		cout<<l.front();l.pop();
		cc++;
	}
}

Compiler output:
a.cc:9:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    9 |  main(){
      |  ^~~~
/tmp/cc2fxpfI.o: in function `main':
a.cc:(.text+0xf): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc2fxpfI.o
a.cc:(.text+0x2b): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc2fxpfI.o
a.cc:(.text+0xfb): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc2fxpfI.o
a.cc:(.text+0x151): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/cc2fxpfI.o
a.cc:(.text+0x162): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc2fxpfI.o
a.cc:(.text+0x17e): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/cc2fxpfI.o
a.cc:(.text+0x1aa): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc2fxpfI.o
a.cc:(.text+0x22a): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc2fxpfI.o
a.cc:(.text+0x2fc): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc2fxpfI.o
a.cc:(.text+0x399): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/cc2fxpfI.o
a.cc:(.text+0x3b7): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<cstdio>
using namespace std;
int a[100005],b[100005];
int main(){
int n,m,i;
scanf("%d%d",&n,&m);
for(i=0;i<m;i++）{
scanf("%d%d",&a[i],&b[i]);
}
printf("2\n%d %d\n",a[0],b[0]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected ')' before '\U0000ff09'
    7 | for(i=0;i<m;i++）{
      |    ~           ^~
      |                )
a.cc:7:16: error: '\U0000ff09' was not declared in this scope
    7 | for(i=0;i<m;i++）{
      |                ^~
Language: C++

#include<cstdio>
int a[100005],b[100005];
int main(){
int n,m,i;
scanf("%d%d",&n,&m);
for(i=0;i<m;i++）{
scanf("%d%d",&a[i],&b[i]);
}
printf("2\n%d %d\n",a[0],b[0]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: expected ')' before '\U0000ff09'
    6 | for(i=0;i<m;i++）{
      |    ~           ^~
      |                )
a.cc:6:16: error: '\U0000ff09' was not declared in this scope
    6 | for(i=0;i<m;i++）{
      |                ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define s second 
#define f first
#define mk make_pair

int n,m;
int main(){
	cin>>n>>m;
	int a[n+1][n+1]={0};
	r(i,m){
		int p1,p2;
		cin>>p1>>p2;
		a[p1][p2]=a[p2][p1]=1;
	}
	r(i,n){
		r(j,n){
			if(a[i+1][j+1]){
				cout<<2<<endl<<i+1<<''<<j+1<<endl;
				return 0;
			}
		}
	}
}

Compiler output:
a.cc:20:53: error: empty character constant
   20 |                                 cout<<2<<endl<<i+1<<''<<j+1<<endl;
      |                                                     ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#ifdef WIN32
    #define lld "%I64d"
#else
    #define lld "%lld"
#endif
 
#define mp make_pair
#define pb push_back
#define put(x) { cout << #x << " = "; cout << (x) << endl; }
 
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef double db;
 
const int M = 1e6 + 15;
const int Q = 1e9 + 7;

 
vector<int> ans;
int used[M];
vector<int> g[M];

void dfs(int v) {
	used[v] = 1;
	ans.pb(v);
	for (auto u : g[v]) {
		if (!used[u]) {
			dfs(u);
			return;
		}	
	}
}
int main() {
    srand(time(NULL));
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
	cin.tie(0);
	ios_base::sync_with_stdio(0);
 
	int n;
	int m;
	cin >> n >> m;
	int v1 = -1 v2 = -1;
	for (int i = 0; i < m; i++) {
		int ai, bi;
		cin >> ai >> bi;
		g[ai].pb(bi);
		g[bi].pb(ai);
		v1 = ai, v2= bi;
	}

	
	used[v1] = used[v2] = 1;
	dfs(v1);
	reverse(ans.begin(), ans.end());
	dfs(v2);
	cout << (int)ans.size() << endl;
	for (auto u : ans)
		cout << u << " ";
	

    return 0;
}   

Compiler output:
a.cc: In function 'int main()':
a.cc:49:21: error: expected ',' or ';' before 'v2'
   49 |         int v1 = -1 v2 = -1;
      |                     ^~
a.cc:55:26: error: 'v2' was not declared in this scope; did you mean 'v1'?
   55 |                 v1 = ai, v2= bi;
      |                          ^~
      |                          v1
a.cc:59:25: error: 'v2' was not declared in this scope; did you mean 'v1'?
   59 |         used[v1] = used[v2] = 1;
      |                         ^~
      |                         v1
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i = a; i < (b); ++i)
#define rrep(i,a,b) for(int i = b; i --> (a);)
#define all(v) v.begin(),v.end()
#define trav(x,v) for(auto &x : v)
#define sz(v) (int)(v).size()
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	
	int n,m;
	cin >> n >> m;
	vector<vi> gr(n);
	vi deg(n);
	rep(_,0,m){
		int a,b;
		cin >> a >> b;
		--a, --b;
		gr[a].push_back(b);
		gr[b].push_back(a);
		++deg[a], ++deg[b];
	}
	vector<bool> vis(n);
	vis[0] = 1;
	deque<int> path(1,0);
	trav(u, gr[0]) --deg[u];
	rep(_,0,2){
		while(deg[path.back()]){
			int v = path.back();
			trav(u, gr[v]) if(!vis[u]){
				vis[u] = 1;
				trav(w, gr[u]) --deg[w];
				path.push_back(u);
				break;
			}
		}
		reverse(all(path));
	}
	cout << sz(path) << endl;
	trav(x, path) cout << x+1 << ' ';
	cout << endl;
}

Compiler output:
a.cc:29:15: error: extended character   is not valid in an identifier
   29 |         vis[0] = 1;
      |               ^
a.cc: In function 'int main()':
a.cc:29:15: error: expected ';' before '\U000000a0'
   29 |         vis[0] = 1;
      |               ^
      |               ;
a.cc:29:14: warning: ignoring return value of 'std::vector<bool, _Alloc>::reference std::vector<bool, _Alloc>::operator[](size_type) [with _Alloc = std::allocator<bool>; reference = std::vector<bool>::reference; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   29 |         vis[0] = 1;
      |              ^
In file included from /usr/include/c++/14/vector:67,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_bvector.h:1086:7: note: declared here
 1086 |       operator[](size_type __n)
      |       ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
const int maxn = 100035;

int a[maxn],n,l,t,x,cnt;

int main()
{
    scanf("%d%d%d",&n,&l,&t);
    for (int i=1; i<=n; i++)
    {
        scanf("%d%d",&a[i],&x);
        a[i] += x==1?t:-t;
        cnt += a[i]/l;
        if (a[i]%l<0) cnt--;　　　　　　　　//就是这里细节的处理
        ((a[i]%=l)+=l)%=l;
    }
    std::sort(a+1, a+n+1);
    ((cnt%=n)+=n)%=n;
    // for (int i=1; i<=n; i++) printf("%d\n",a[i]);
    for (int i=cnt+1; i<=n; i++) printf("%d\n",a[i]);
    for (int i=1; i<=cnt; i++) printf("%d\n",a[i]);
    return 0;
}

Compiler output:
a.cc:14:29: error: extended character 　 is not valid in an identifier
   14 |         if (a[i]%l<0) cnt--;　　　　　　　　//就是这里细节的处理
      |                             ^
a.cc:14:29: error: extended character 　 is not valid in an identifier
a.cc:14:29: error: extended character 　 is not valid in an identifier
a.cc:14:29: error: extended character 　 is not valid in an identifier
a.cc:14:29: error: extended character 　 is not valid in an identifier
a.cc:14:29: error: extended character 　 is not valid in an identifier
a.cc:14:29: error: extended character 　 is not valid in an identifier
a.cc:14:29: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:14:29: error: '\U00003000\U00003000\U00003000\U00003000\U00003000\U00003000\U00003000\U00003000' was not declared in this scope
   14 |         if (a[i]%l<0) cnt--;　　　　　　　　//就是这里细节的处理
      |                             ^~~~~~~~~~~~~~~~
Language: C++

#include<algorithm>
#include<cstdio>
#include<iostream>
#include<cmath>
#define N 200005
using namespace std;
int n,l,t;
long long Rank
int x[N],w[N],e[N];
int main()
{
	scanf("%d%d%d",&n,&l,&t);
	Rank=1;
	for (int i=1;i<=n;i++)
	{
		scanf("%d%d",&x[i],&w[i]);
		e[i]=x[i]+((w[i]==1)?1:-1)*t;
		e[i]%=l;
		e[i]=(e[i]+l)%l;
		if (w[i]==1)
			Rank+=(x[i]+t)/l; else
			Rank-=(l-x[i]-1+t)/l;
	}
	sort(e+1,e+n+1);
	for (int i=Rank;i<=n;i++)
		printf("%d\n",e[i]);
	for (int i=1;i<Rank;i++)
		printf("%d\n",e[i]);
	return 0;
}

Compiler output:
a.cc:9:1: error: expected initializer before 'int'
    9 | int x[N],w[N],e[N];
      | ^~~
a.cc: In function 'int main()':
a.cc:13:9: error: 'Rank' was not declared in this scope
   13 |         Rank=1;
      |         ^~~~
a.cc:16:31: error: 'x' was not declared in this scope
   16 |                 scanf("%d%d",&x[i],&w[i]);
      |                               ^
a.cc:16:37: error: 'w' was not declared in this scope
   16 |                 scanf("%d%d",&x[i],&w[i]);
      |                                     ^
a.cc:17:17: error: 'e' was not declared in this scope
   17 |                 e[i]=x[i]+((w[i]==1)?1:-1)*t;
      |                 ^
a.cc:24:14: error: 'e' was not declared in this scope
   24 |         sort(e+1,e+n+1);
      |              ^
Language: C++

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

int main(){
  int N, L, T;
  cin >> N >> L >> T;
  vector<int> x(N+1);
  vector<int> w(N+1);
  for(int i = 0; i < N; i++){
    cin >> x[i] >> w[i];
  }
  x[N] = x[0]; 
  w[N] = w[0];
  
  for(int t = 1; t <= T; t++){
    for(int i = 0; i < N; i++){
      if((x[i] == x[i+1]-1 || x[i] == x[i+1]+L-1) && w[i] == 1 && w[i+1] == 2){//差が１、向かい合うとき
        swap(w[i], w[i+1]);
        i = i + 1;
      }
      else if((x[i] == x[i+1]) && w[i] == 1 && w[i+1] == 2){//差が０、向かい合うとき
        x[i] = (x[i]-1)%L;
        x[i+1] =  (x[i]+1)%L;
        swap(w[i], w[i+1]);
        i = i + 1;
      }
      else{    
        if(w[i] == 1){
           x[i] = (x[i]+1) % L;
        }
        else{
           x[i] = (x[i]-1) % L;
        }
      }
    }
  }
  cout << x[i]+1 << endl;
  for(int i = 1; i < N; i++){//出力
    cout << x[i] << endl;
  }
}

  


Compiler output:
a.cc: In function 'int main()':
a.cc:37:13: error: 'i' was not declared in this scope
   37 |   cout << x[i]+1 << endl;
      |             ^
Language: C++

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

int name(){
  int N, L, T;
  cin >> N >> L >> T;
  vector<int> x(N+1);
  vector<int> w(N+1);
  for(int i = 0; i < N; i++){
    cin >> x[i] >> w[i];
  }
  x[N] = x[0]; 
  w[N] = w[0];
  
  for(int t = 1; t <= T; t++){
    for(int i = 0; i < N; i++){
      if((x[i] == x[i+1]-1 || x[i] == x[i+1]+L-1) && w[i] == 1 && w[i+1] == 2){//差が１、向かい合うとき
        swap(w[i], w[i+1]);
        i = i + 1;
      }
      else if((x[i] == x[i+1]) && w[i] == 1 && w[i+1] == 2){//差が０、向かい合うとき
        x[i] = (x[i]-1)%L;
        x[i+1] =  (x[i]+1)%L;
        swap(w[i], w[i+1]);
        i = i + 1;
      }
      else{    
        if(w[i] == 1){
           x[i] = (x[i]+1) % L;
        }
        else{
           x[i] = (x[i]-1) % L;
        }
      }
    }
  }
  for(int i = 0; i < N; i++){//出力
    cout << x[i] << endl;
  }
}

  

Compiler output:
a.cc: In function 'int name()':
a.cc:40:1: warning: no return statement in function returning non-void [-Wreturn-type]
   40 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int name(){
  int N, L, T;
  cin >> N >> L >> T;
  vector<int> x(N+1);
  vector<int> w(N+1);
  for(int i = 0, i < N; i++){
    cin >> x[i] >> w[i];
  }
  x[N] = x[0]; 
  w[N] = w[0];
  
  for(int t = 1; t <= T; t++){
    for(i = 0; i < N; i++){
      if((x[i] == x[i+1]-1 || x[i] == x[i+1]+L-1) && w[i] == 1 && w[i+1] == 2){//差が１、向かい合うとき
        swap(w[i], w[i+1]);
        i = i + 1;
      }
      else if((x[i] == x[i+1]) && w[i] == 1 && w[i+1] == 2){//差が０、向かい合うとき
        x[i] = (x[i]-1)%L
        x[i+1] =  (x[i]+1)%L
        swap(w[i], w[i+1]);
        i = i + 1;
      }
      else{    
        if(w[i] == 1){
           x[i] = (x[i]+1) % L;
        }
        else{
           x[i] = (x[i]-1) % L;
        }
      }
    }
  }
  for(int i = 0; i < N; i++){//出力
    cin << x[i] << endl;
  }
}

  

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

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N,L,T;
    cin>>N>>L>>T;
    int x[N],w[N];
    for(int i=0;i<N;i++)cin>>x[i]>>w[i];
    int count=0;
    int y[N];
    
    for(int i=0;i<N;i++){
        if(w[i]==1) {
          y[i]=(x[i]+T)%L;
        count+=(x[i]+T)/L;

        }
        else {
            y[i]=((x[i]-T)%L+L)%L;
            if(T > x[i]){
                count -= (T-x[i])/L;
                if((x[i]-T)%L<0) count--;
            
        }
    }
        sort(y,y+N);
        count=(count%N+N)%N;
        for(int i=count;i<N;i++){
            cout<<y[i]<<endl;
            }
        for(int i=0;i<count;i++){
            cout<<y[i]<<endl;
        }
        return 0;

    
    
}

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

#include<bits/stdc++.h>
#define rep(i,n) for(long long i=0;i<(n);i++)
#define ll long long
using namespace std;
int main(){
    ll L,N,T;
    vector<ll> X;
    vector<int> W;
    cin >> N >> L >> T;
    rep(i,N) {
        ll a,b;
        cin >> a >> b;
        X.push_back(a);W.push_back(b);
    };
    vector<ll> ans; ll count = 0;
    rep(i,N){
        ll d = (W[i] == 1) ? (X[i] + T) : (X[i] - T);
        if(W[i] == 1){
            count += d/L; 
        } else {
            if(d < 0) count += -1 + d/L ;
        }
        d %= L; 
        if(d < 0) d = L + d; 
        ans.push_back(d);
    }
    count = (count % N + N)%N;

    sort(ans.begin(),ans.end());
    rep(i,N){
        int p = (i + count)%N;
        if(p < 0) p = n + p;
        cout << ans[p] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:23: error: 'n' was not declared in this scope
   32 |         if(p < 0) p = n + p;
      |                       ^
Language: C++

#include <bits/stdc++.h>

int N, L, T;
float X[110000];
int W[110000];

int main () {
  cin >> N >> L >> T;
  for (int i = 1; i < N + 1; i++) cin >> X[i] >> W[i];
  
  for (float t = 0.5; t <= T; t += 0.5) {
    //t秒のときの位置へ移動
    for (int i = 1; i < N + 1; i++) {
      if (W[i] == 1) {
        X[i] += 0.5;
      } else {
        X[i] -= 0.5;
      }
      //円の始点終点調整
      if (X[i] == L) {
        X[i] = 0;
      } else if (X[i] < 0) {
        X[i] = (float)L - 0.5;
      }
    }
    //衝突判定
    for (int i = 1; i < N; i++) {
      if (X[i] == X[i + 1]) {
        W[i] = 2;
        W[i + 1] = 1;
      }
    }
    if (X[1] == X[N]) {
      W[1] = 1;
      W[N] = 2;
    }
  }
  
  //出力
  for (int i = 1; i < N + 1; i++) {
    cout << (int)X[i]
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin >> N >> L >> T;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:41:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   41 |     cout << (int)X[i]
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;
int main() {
  int n,len,t;
  double x[n];
  int w[n];
  for (int i=0; i<n; i++) {
    cin >> x[i];
    cin >> w[i];
  }
  
  for (int i=0; i<t; i++) {
    for (int j=0; j<n; j++) {
      // get target ant
      int f = j - 1;
      int b = j + 1;
      if (j == 0) { f = n; }
      if (w[j] == 2) {
        // clockwise
        // change way.
        if (w[f] == 1 && x[j] == x[f] + 1) { 
          w[j] = 1;
        } else {
          if (x[j] == 0) { x[j] = len - 1; }
          else { x[j] -= 1; }
        }
      }

      if (w[j] == 1) {
        // anticlockwise
        // change way.
        if (w[b] == 2 && x[j] + 1 == x[b]) { 
          w[j] = 1;
        } else {
          if (x[j] == len) { x[j] = 0; }
          else { x[j] += 1; }
        }
      }
    }
  for (int i=0; i<n; i++) {
    cout << x[i] << endl;
  }
  
  return 0;
}


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

#include <iostream>
#include <string>

using namespace std;
int main() {
  int n,len,t;
  double x[n];
  int w[n];
  for (int i=0; i<n; i++) {
    cin >> x[i];
    cin >> w[i];
  }
  
  for (int i=0; i<t; i++) {
    for (int j=0; j<n; j++) {
      // get target ant
      int f = j - 1;
      int b = j + 1;
      if (j == 0) { f = n }
      if (w[j] == 2) {
        // clockwise
        // change way.
        if (w[f] == 1 && x[j] == x[f] + 1) { 
          w[j] = 1;
        } else {
          if (x[j] == 0) { x[j] = len - 1; }
          else { x[j] -= 1; }
        }
      }

      if (w[j] == 1) {
        // anticlockwise
        // change way.
        if (w[b] == 2 && x[j] + 1 == x[b]) { 
          w[j] = 1;
        } else {
          if (x[j] == len) { x[j] = 0; }
          else { x[j] += 1; }
        }
      }
    }
  for (int i=0; i<n; i++) {
    cout << x[i] << endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:26: error: expected ';' before '}' token
   19 |       if (j == 0) { f = n }
      |                          ^~
      |                          ;
a.cc:47:2: error: expected '}' at end of input
   47 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long long int N,L,T,S=0,x;
  cin>>N>>L>>T;
  vector<long long int>X(N),H(N),W(N);
  for(long long int i=0;i<N;i++){
    cin>>X.at(i)>>W.at(i);
    H.at(i)=X.at(i);
  }
  for(long long int i=0;i<N;i++){
    if(W.at(i)==1)X.at(i)=(X.at(i)+T)%L;
    else X.at(i)=(X.at(i)-T+L)%L;
    if(X.at(i)<0)X.at(i)+=L;
  }
  x=X.at(0);
  sort(X.begin(),X.end());
  for(long long int i=1;i<N;i++)if(W.at(i)!=W.at(0)){
    if(W.at(0)==1)S+=(2*T-H.at(i)+H.at(0))/L+1;
    else S-=(2*T+H.at(i)-H.at(0))/L;
  }
  long long int p=0,q=1;
  while(X.at(p)!=x)p++;
  while(q<N&&W.at(0)!=W.at(q))q++;
  if(q<min(N,3)&&H.at(q)-H.at(0)!=X.at((p+q)%N)-X.at(p)&&X.at((p+1)%N)==x)p++;
  p=(p-S)%N;if(p<0)p+=N;
  for(long long int i=0;i<N;i++)cout<<X.at((p+i)%N)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: no matching function for call to 'min(long long int&, int)'
   25 |   if(q<min(N,3)&&H.at(q)-H.at(0)!=X.at((p+q)%N)-X.at(p)&&X.at((p+1)%N)==x)p++;
      |        ~~~^~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:25:11: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   25 |   if(q<min(N,3)&&H.at(q)-H.at(0)!=X.at((p+q)%N)-X.at(p)&&X.at((p+1)%N)==x)p++;
      |        ~~~^~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:25:11: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   25 |   if(q<min(N,3)&&H.at(q)-H.at(0)!=X.at((p+q)%N)-X.at(p)&&X.at((p+1)%N)==x)p++;
      |        ~~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

/*座標0を軸としてアリの順番が何匹ずれたかだけを記憶し、順番は考慮せずにアリが存在する位置を計算。
アリが座標0を通るたびにアリの順番をずらす。
位置をソートしたのち、アリがずれた分だけ配列をずらして出力。*/
int main(void){
    int N, L, T, x, w, gap;
    cin >> N >> L >> T;
    vector<int> X;
    rep(i,N){
        cin >> x >> w;
        x += ((w+1) % 3 - 1) * T;
        gap += x / L;
        if(x < 0 && x % L != 0)gap--;
        X.emplace_back(((x % L) + L) % L)
    }
    sort(X.begin(), X.end()); 
    rep(i,N)cout << X[(((gap + i) % N) + N) % N] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:42: error: expected ';' before '}' token
   17 |         X.emplace_back(((x % L) + L) % L)
      |                                          ^
      |                                          ;
   18 |     }
      |     ~
Language: C++

1.	#include<bits/stdc++.h>
2.	#define N 100005
3.	using namespace std;
4.	int n,L,t,a[N],num;
5.	int main()
6.	{
7.		int i,x,y;
8.		cin>>n>>L>>t;
9.		for(i=0;i<n;i++){
10.			scanf("%d %d",&x,&y);
11.			x+=(y==1 ? t : -t);
12.			(num+=x/L)%=n,x%=L;
13.			if(x<0) x+=L,num--;
14.			a[i]=x;
15.		  }
16.		sort(a,a+n);
17.		for(i=0;i<n;i++)
18.			printf("%d\n",a[(i+num+n)%n]);
19.		return 0;
20.	}


Compiler output:
a.cc:1:9: error: stray '#' in program
    1 | 1.      #include<bits/stdc++.h>
      |         ^
a.cc:2:9: error: stray '#' in program
    2 | 2.      #define N 100005
      |         ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1.      #include<bits/stdc++.h>
      | ^~
a.cc:4:1: error: expected unqualified-id before numeric constant
    4 | 4.      int n,L,t,a[N],num;
      | ^~
a.cc:5:1: error: expected unqualified-id before numeric constant
    5 | 5.      int main()
      | ^~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>

#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define repp(i, m, n) for(ll i = m, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define clr(ar, val) memset(ar, val, sizeof(ar))
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

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

template <class T> div_minus (T a, T b) {
	if (a % b < 0) return a / b - 1;
	else return a / b;
}
template <class T> T mod_minus (T a, T b) {
	if (a % b < 0) return a % b + b;
	else return a % b;
}
int main(void)
{
	ll n, l, t;
	cin >> n >> l >> t;
	vector<ll> x(n), w(n);
	vector<P> res(n);
	rep (i, n) {
		cin >> x[i] >> w[i];
		if (w[i] == 1) res[i].first = (x[i] + t) % l;
		else res[i].first = mod_minus(x[i] - t, l);
		res[i].second = i;
	}
	ll count = 0;
	repp (i, 1, n) {
		if (w[0] == 1) {
			if (w[i] == 2) {
				// cout << i << ": " << div_minus(2 * t - (x[i] - x[0]), l) + 1 << endl;
				count += div_minus(2 * t - (x[i] - x[0]), l) + 1;
			}
		} else {
			if (w[i] == 1) {
				// cout << i << ": " << div_minus(2 * t - (l + x[0] - x[i]), l) + 1 << endl;
				count -= div_minus(2 * t - (l + x[0] - x[i]), l) + 1;
			}
		}
	}
	sort(all(res));
	ll k;
	for (k = 0; k < n; k++) {
		if (res[k].second == 0) break;
	}
	count = mod_minus(k - count, n);
	rep(i, n) {
		cout << res[(i + count) % n].first << endl;
	}
	return 0;
}

Compiler output:
a.cc:36:20: error: ISO C++ forbids declaration of 'div_minus' with no type [-fpermissive]
   36 | template <class T> div_minus (T a, T b) {
      |                    ^~~~~~~~~
Language: C

#include<bits/stdc++.h>
#define fo(i,a,b) for(i=a;i<=b;i++)
using namespace std;
#define ll long long
const int maxn=100000+10;
int x[maxn],xx[maxn],w[maxn];
int i,j,k,l,r,s,t,n,m;
ll c;
inline int read()
{
    int k=1;int x=0;
    char ch=getchar();
    while ((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
    if(ch=='-')
    k=-1,ch=getchar();
    while(ch>='0'&&ch<='9')
    x=x*10+ch-'0',ch=getchar();
    return k*x;
}
int main()
{
    n=read(),l=read(),t=read();
    fo(i,1,n)
        x[i]=read(),w[i]=read();
    fo(i,1,n)
    {
        if (w[i]==2) w[i]=-1;
        r=x[i]+w[i]*t;
        if (r>0) (c+=r/l)%=n;
        else if (r<0) (c+=(r+1)/l-1)%=n;
        xx[i]=(r%l+l)%l;
    }
    sort(xx+1,xx+n+1);
    c=(c+n)%n;
    fo(i,c+1,n)
        printf("%d\n",xx[i]);
    fo(i,1,c) printf("%d\n",xx[i]);
}

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

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
	public static void main(String[] args){



		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		int l = sc.nextInt();
		long t = sc.nextInt();

		int[] x = new int[n];
		int[] w = new int[n];

		for(int i=0;i<n;i++) {
			x[i] =  sc.nextInt();
			w[i] =  sc.nextInt();
		}

		int[] y = new int[n];



		ArrayList<Integer> list = new ArrayList<>();
		for(int i = 0;i<n;i++) {
			if(w[i]==1) {
				y[i] = location(l,x[i]+t);
			}else {
				y[i] = location(l,x[i]-t);
			}
			list.add(y[i]);
		}
		int firstIndex = y[0];
		Collections.sort(list);

		long counter =0;

		if(w[0]==1) {
			for(int i = 1;i<n;i++) {
				if(w[i]==2) {
					if(t*2-(x[i]-x[0])<0) {

					}else {
						counter+=(t*2-(x[i]-x[0]))/l+1;
					}
				}
			}
			counter = (counter+1)%n;
			if(counter ==0)counter =n;

		}else {
			for(int i = n-1;i>0;i--) {
				if(w[i]==1) {
					if(t*2-(x[0]+l-x[i])<0) {

					}else {
						counter+=(t*2-(x[0]+l-x[i]))/l+1;
					}
				}
			}
			counter = (1-counter);

			counter = counter%n;
			if(counter<=0)counter+=n;
		}


		int offset = list.indexOf(firstIndex)-counter;
		for(int i =1;i<n+1;i++) {
			int listindex = offset+i;
			if(listindex<0) {
				listindex+=n;
			}
			if(listindex>=n) {
				listindex-=n;
			}
			System.out.println(list.get(listindex));
		}



		/*
		TreeMap<Integer,Integer> treeMap = new TreeMap<>();//sorted no duplication
		treeMap.put(b[n], n);
		*/

	}

	static int location(int length,long value) {

		int loc = (int) (value%length);
		if(loc<0)loc+=length;

		return loc;
	}

}
/*
class City{
	int order;
	int prefecture;
	int year;
	int number;
	City(int order,int prefecture, int year){
		this.order = order;
		this.prefecture = prefecture;
		this.year = year;
	}
}
*/


Compiler output:
Main.java:72: error: incompatible types: possible lossy conversion from long to int
		int offset = list.indexOf(firstIndex)-counter;
		                                     ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
	public static void main(String[] args){



		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		int l = sc.nextInt();
		long t = sc.nextInt();

		int[] x = new int[n];
		int[] w = new int[n];

		for(int i=0;i<n;i++) {
			x[i] =  sc.nextInt();
			w[i] =  sc.nextInt();
		}

		int[] y = new int[n];



		ArrayList<Integer> list = new ArrayList<>();
		for(int i = 0;i<n;i++) {
			if(w[i]==1) {
				y[i] = location(l,x[i]+t);
			}else {
				y[i] = location(l,x[i]-t);
			}
			list.add(y[i]);
		}
		int firstIndex = y[0];
		Collections.sort(list);

		long counter =0;
		
		if(w[0]==1) {
			for(int i = 1;i<n;i++) {
				if(w[i]==2) {
					if(t*2-(x[i]-x[0])<0) {

					}else {
						counter+=(t*2-(x[i]-x[0]))/l+1;
					}
				}
			}
			counter = (counter+1)%n;
			if(counter ==0)counter =n;

		}else {
			for(int i = n-1;i>0;i--) {
				if(w[i]==1) {
					if(t*2-(x[0]+l-x[i])<0) {

					}else {
						counter+=(t*2-(x[0]+l-x[i]))/l+1;
					}
				}
			}
			counter = (1-counter);

			counter = counter%n;
			if(counter<=0)counter+=n;
		}
		
		
		int offset = list.indexOf(firstIndex)-counter;
		for(int i =1;i<n+1;i++) {
			int listindex = offset+i;
			if(listindex<0) {
				listindex+=n;
			}
			if(listindex>=n) {
				listindex-=n;
			}
			System.out.println(list.get(listindex));
		}

		

		/*
		TreeMap<Integer,Integer> treeMap = new TreeMap<>();//sorted no duplication
		treeMap.put(b[n], n);
		*/

	}

	static int location(int length,long value) {

		int loc = (int) (value%length);
		if(loc<0)loc+=length;

		return loc;
	}

}
/*
class City{
	int order;
	int prefecture;
	int year;
	int number;
	City(int order,int prefecture, int year){
		this.order = order;
		this.prefecture = prefecture;
		this.year = year;
	}
}
*/


Compiler output:
Main.java:72: error: incompatible types: possible lossy conversion from long to int
		int offset = list.indexOf(firstIndex)-counter;
		                                     ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int x[100010],w[100010];
int ans[100010]; 
int n,L,r,t;
long long fldl;
int main()
{
	scanf("%d%d%d",&n,&L,&t);
    for(int i = 1;i <= n;i++)
    {
        scanf("%d%d",&x[i],&w[i]);
		if(w[i] == 2)w[i] = -1;
	}
    for(int i = 1;i <= n;i++)
    {
        len = x[i] + w[i] * t;
        if (len > 0) (fldl += len / L) %= n;
        else if (len < 0) (fldl += (len + 1) / L - 1) %= n;
        ans[i] = (len % L + L) % L;
    }
    sort(ans + 1 ,ans + n + 1);
    fldl = (fldl + n) % n;
    for(int i = fldl + 1;i <= n;i++)printf("%d\n",ans[i]);
    for(int i = 1;i <= fldl;i++) printf("%d\n",ans[i]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'len' was not declared in this scope
   17 |         len = x[i] + w[i] * t;
      |         ^~~
Language: C++

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

int main(){
  ll N, L, T;
  cin >> N >> L >> T;
  ll x[N], w[N];
  for(int i = 0; i < N; i++){
    cin >> x[i] >> w[i];
  }
  ll xx[N], ww[N];
  for(int i = 0; i < N; i++){
    xx[i] = x[i];
    ww[i] = w[i];
  }
  for(int i = 0; i < N; i++){
    if(w[i] == 1){
      xx[i]+=T;
      xx[i] = xx[i]%L;
    }
    else{
      xx[i]-=T;
      xx[i] = xx[i]%L;
    }
  }
  for(int i = 0; i < N; i++){
    if(w[i] == 1){
      x[i] += T;
    }
    else{
      x[i] -= T;
    }
  }
  ll count = 0;
  if(w[0] == 1){
    for(int i = 0; i < N; i++){
      x[i] -= x[0];
      if(x[i] < 0){
        x[i] += L;
      }
    }
    for(int i = 0; i < N; i++){
      if(w[i] == 2){
        if(x[i] <= 2*T%L){
          count++;
        }
      }
    }
  }
  else{
    for(int i = 0; i < N; i++){
      x[i] = L-x[i];
      x[i] -= x[0];
      if(x[i] < 0){
        x[i] += L;
      }
    }
    for(int i = 0; i < N; i++){
      if(w[i] == 1){
        if(x[i] <= 2*T%L){
          count++;
        }
      }
    }
  }
  for(int i = 0; i < N; i++){
    cout << xx[(i+count)%N)] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:27: error: expected ']' before ')' token
   68 |     cout << xx[(i+count)%N)] << endl;
      |                           ^
      |                           ]
a.cc:68:27: error: expected ';' before ')' token
   68 |     cout << xx[(i+count)%N)] << endl;
      |                           ^
      |                           ;
Language: C++

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

int main(){
  int counting=0;
  int N,L,T;
  cin >> N >> L >> T;
  int x[N];
  int vec[2];
  
  for(int i=0; i<N; i++){
    cin >> x[i] >> vec[i];
  }
  
  for (i=0; i<N; i++){
    if(vec[i] == 1){
      x[i] += T;
    }else if(vec[i] == 2){
      k[i] -= T;
    }
  }
  
  for(i=0; i<N; i++){
    if(x[i]<0){
      counting++;
      x[i]+=L
    }else if(x[i]>L){
      counting++;
      x[i]-=L;
    }
  }
  
  sort(x.begin(),x.end());
  
  for(i=0; i<N; i++){
    if(i+counting > N){
      int k;
      k=i+counting-N;
      x[k] = x[i];
    }else{
      x[i+counting] = x[i];
    }
  }
  
  for(i=0; i<N; i++){
    cout << x[i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: 'i' was not declared in this scope
   15 |   for (i=0; i<N; i++){
      |        ^
a.cc:19:7: error: 'k' was not declared in this scope
   19 |       k[i] -= T;
      |       ^
a.cc:23:7: error: 'i' was not declared in this scope
   23 |   for(i=0; i<N; i++){
      |       ^
a.cc:33:10: error: request for member 'begin' in 'x', which is of non-class type 'int [N]'
   33 |   sort(x.begin(),x.end());
      |          ^~~~~
a.cc:33:20: error: request for member 'end' in 'x', which is of non-class type 'int [N]'
   33 |   sort(x.begin(),x.end());
      |                    ^~~
a.cc:35:7: error: 'i' was not declared in this scope
   35 |   for(i=0; i<N; i++){
      |       ^
a.cc:45:7: error: 'i' was not declared in this scope
   45 |   for(i=0; i<N; i++){
      |       ^