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

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

int main(){
  int N,L,T,k;
  double X[1000000000];
  int W[1000000000];
  cin >> N >> L >> T;
  
  for(int i=0; i<N; i++){
    cin >> X[i] >> W[i];
  }
  int TIME=2*T;
  int newT;
  for(newT=0; newT<TIME; newT++){
    //座標操作
    for(i=0; i<N; i++){
      if(W[i] == 1){
        X[i] += 0.5;
      }else if(W[i] == 2){
        X[i] -= 0.5;
      }
      X[i]=X[i]%(double)L;
      //座標被ったときに方向転換させる
      for(int k=0; k<=i; k++){
        if(X[i] == X[k]){
          if(W[i] == 1){
            W[i] = 2;
          }else if(W[i] == 2){
            W[i] = 1;
          }
        }
      }
    }
  }
  
  for(k=0; k<N; k++){
    cout << X[k] << endl;
  }
}
    

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

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(V) V.begin(),V.end()

ll L;
ll lmod(ll A) {
	if (A < 0) {
		A = 0 - A;
		A %= L;
		A = L - A;
	}
	else A %= L;
	return A;
}

int main() {
	ll N, T, X, W, X1, W1;
	cin >> N >> L >> T;
	vector<ll> Lant;
	vector<ll> Rant;
	vector<ll> last(N);
	for (int i = 0;i < N;i++) {
		cin >> X >> W;
		if (i == 0)	X1 = X, W1 = W;
		if (W == 1) {
			Rant.push_back(lmod(X1 - X));
			last[i] = lmod(X + T);
		}
		else {
			Lant.push_back(X - X1);
			last[i] = lmod(X - T);
		}
	}

	ll Ras = Rant.size();
	ll Las = Lant.size();
	sort(all(last));
	reverse(all(Rant));
	
	ll ri = 0, le = 0, r_it = 0, l_it = 0, fmet;
	
	for (ll tim = 0; tim <= T;) {
		if (W == 1) {
			if (tim == 0 && Rant[r_it] == 0) {
				Rant[r_it] += L;
				r_it++;
				if (r_it == Ras) r_it = 0;
				continue;
			}
			fmet = Lant[l_it] - ri;
			if (tim + (fmet + 1) / 2 > T) {
				X1 += T - tim;
				break;
			}
			X1 += fmet / 2; //ぶつかるまでの距離/2=時間
			tim += (fmet + 1) / 2;
			//途中でぶつかったら位置は切り捨てればよい Lantの要素との距離の差は距離分短くなるだけ
			ri = Lant[l_it];
			Lant[l_it] += L;
			l_it++;
			if (l_it == Las)
				l_it = 0;
			if (fmet % 2)
				le++;
			W = 2;
		}
		else {
			if (tim == 0 && Lant[l_it] == 0) {
				Lant[l_it] += L;
				l_it++;
				if (l_it == Las) l_it = 0;
				continue;
			}
			fmet = Rant[r_it] - le;
			if (tim + (fmet + 1) / 2 > T) {
				X1 = lmod(X1 - (T - tim));
				break;
			}
			X1 = lmod(X1 - fmet / 2);
			tim += (fmet + 1) / 2;
			le = Rant[r_it];
			Rant[r_it] += L;
			r_it++;
			if (r_it == Ras)
				r_it = 0;
			if (fmet % 2)
				ri++;
			W = 1;
		}
	}
	auto it = lower(all(last), X1);
	for (int i = 0;i < N;i++) {
		cout << *it << endl;
		it++;
		if (it == last.end())
			it = last.begin();
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:92:19: error: 'lower' was not declared in this scope; did you mean 'tolower'?
   92 |         auto it = lower(all(last), X1);
      |                   ^~~~~
      |                   tolower
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
ll N,L,T;
ll X[100100],W[100100];
vector<int> A;
int main(){
	cin >> N >> L >> T;
	for(int i=0;i<N;i++){
		cin >> X[i] >> W[i];
	}
	ll cnt = 0;
	ll K;
	for(int i=0;i<N;i++){
		int to;
		if(W[i]==1){
			to = (X[i]+T)%L;
		}else{
			to = (X[i]+L-T%L)%L;
		}
		if(i==0)K=to;
		A.pb(to);
		ll dist;
		if(W[i]!=W[0]){
			if(W[0]==1){
				dist = (X[i]-X[0]+L)%L;
			}else{
				dist = (X[0]-X[i]+L)%L;
			}
			if(dist<2*T)cnt += 1+(2*T-dis-1)/L;
		}
	}
	sort(all(A));
	ll id = 0;
	if(W[0]==1){
		id = cnt%N;
	}else{
		id = ((-cnt)%N+N)%N;
	}
	ll idx = -1;
	if(W[0]==2){
		for(int i=N-1;i>=0;i--){
			if(A[i]==K){
				idx = i;
				break;
			}
		}
	}else{
		for(int i=0;i<N;i++){
			if(A[i]==K){
				idx = i;
				break;
			}
		}
	}
	//cout << idx << ' ' << id << endl;
	ll st = (idx-id+N)%N;
	for(int i=0;i<N;i++){
		ll j = (st+i)%N;
		cout << A[j] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:51: error: 'dis' was not declared in this scope; did you mean 'dist'?
   47 |                         if(dist<2*T)cnt += 1+(2*T-dis-1)/L;
      |                                                   ^~~
      |                                                   dist
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vv vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define INF 1000000000
#define eps 1e-7
#define mod 1000000007
#define int ll
using namespace std;

int N, L, T;

int dist(int a, int b) { //座標aから座標bへ時計回りにみた距離
    if (a <= b) return b-a;
    else return L-(a-b);
}

int meets(dist) {
    if (T >= meets/2.)
}

int X[100000 + 10];
int W[100000 + 10];

signed main() {
    vi last_pos;
    cin >> N >> L >> T;
    rep(i, N) {
        cin >> X[i] >> W[i];
        if (W[i] == 1) last_pos.pb((X[i] + T) % L);
        else last_pos.pb((X[i] + L * (int)1e10 - T) % L);
    }
    int last;
    if (W[0] == 1) { //時計回り
        int encount=0;
        Rep(i, 1, N) {
            if (W[1] == 2) {
                int a = dist(X[0], X[i]);
                if (T >= a/2.) { 
                    encount++;
                    double restT = T - a/2.;
                    encount += floor(restT / (L / (double)2));
                }
            }
        }
        // cout << encount << endl;
        last = encount % N;
    } else { //反時計回り
        int encount=0;
        Rep(i, 1, N) {
            if (W[1] == 1) {
                int a = dist(X[i], X[0]);
                // cout << "a:" << a << endl;
                if (T >= a/2.) { 
                    encount++;
                    double restT = T - a/2;
                    encount += floor(restT / (L / (double)2));
                }
            }
        }
        // cout << encount << endl;
        last = ((N * (int)1e10) - encount) % N;
    }
    
    rotate(last_pos.begin(), last_pos.begin()+N-last, last_pos.end());
    for(auto e:last_pos) {
        cout << e << endl;
    }
    
    return 0;
}

Compiler output:
a.cc:29:15: error: invalid conversion from 'long long int (*)(long long int, long long int)' to 'long long int' [-fpermissive]
   29 | int meets(dist) {
      |               ^
      |               |
      |               long long int (*)(long long int, long long int)
a.cc:29:17: error: expected ',' or ';' before '{' token
   29 | int meets(dist) {
      |                 ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

using i64 = int64_t;

const i64 MOD = 1e9+7;

const i64 INF = 1e18+7;


signed main(){
    i64 n, l, t;
    cin >> n >> l >> t;
    vector<i64> a(n), b(n);
    vector<i64> after(n);
    for(int i = 0; i < n; ++i){
        cin >> a[i] >> b[i];
        --b[i];

        after[i] = ((i64)1e9 * l + (a[i] + (b[i] ? -1 : 1) * t)) % l;
    }

    // 時計回りのものの個数
    i64 b_c = count(b.begin(), b.end(), 0);
    if(b_c == 0){
        // 全員時計回り
        return 0;
    }else if (b_c == n){
        // 全員半時計回り
        return 0;
    }
    i64 po = a[distance(b.begin(), find(b.begin(), b.end(), 1))];
    vector<i64> rev;
    for(int i = 0; i < n; ++i)
        if(b[i])
            // poから見て相対的にどの位置にいるか
            rev.emplace_back((a[i] - po + l) % l);

    // 周回数(2倍している)
    i64 turn = (2 * t) / l;
    i64 dist = distance(rev.begin(), lower_bound(rev.begin(), rev.end(), (2 * t) % l));
    // 衝突回数
    i64 conf = turn * rev.size() + dist;
    conf %= n;
    i64 po_after = (po + t) % l;
    sort(after.begin(), after.end());
    int po_ind = distance(after.begin(), lower_bound(after.begin(), after.end(), po_after));
    for(int i = 0; i < n; ++i)
        cout << after[(po_ind + conf + i) % n]
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:47: error: expected ';' before '}' token
   50 |         cout << after[(po_ind + conf + i) % n]
      |                                               ^
      |                                               ;
   51 | }
      | ~
Language: C++

//By Don4ick 
//#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>

typedef long long ll;
typedef long double ld;
typedef unsigned int ui;
#define int long long
#define forn(i, n) for (int i = 1; i <= n; i++)
#define pb push_back
#define all(x) x.begin(), x.end()
#define y1 qewr1234

const double PI = acos(-1.0);
const int DIR = 4;
const int X[] = {1, 0, -1, 0};
const int Y[] = {0, 1, 0, -1};

const int N = (int)1e5 + 228;

using namespace std;

int n, L, T, pos[N], dir[N], res[N];

int go(int id, int t2)
{
	queue < int > w1, w2;
	for (int i = 0; i < n; i++)
	{
		if (dir[(id + i) % n] == 2)
			w2.push(pos[(id + i) % n]);
	}                  
	for (int i = 0; i < n; i++)
	{
		if (dir[(id - i + n) % n] == 1)
			w1.push(pos[(id - i + n) % n]);	
	}
	int t1 = 0, d = dir[id], x = pos[id];
	while(t1 < t2)
	{
		if (d == 1)
		{
			if (w2.empty())
			{	
				x = (x + t2 - t1) % L;
				break;
			}  
			int y = (w2.front() - t1 + L) % L;
			int t3 = (y - x + 1) / 2;
			if (x > y)
				t3 = (L - x + y + 1) / 2;
			if (t2 - t1 < t3)
			{
				x = (x + t2 - t1) % L;
				break;
			}
			w2.push(w2.front());
			w2.pop();	
			if (t3 > 0)
			{	
				w1.push(w1.front());
				w1.pop();
				x = (y - t3 + L) % L;
				t1 += t3;
			}
			d = 2;
		}
		else
		{
			if (w1.empty())
			{
				x = (x - t2 + t1 + L) % L;
				break;
			}
			int y = (w1.front() + t1) % L;
			int t3 = (x - y + 1) / 2;
			if (y > x)
			{
				t3 = (L - y + x + 1) / 2;
			}
			if (t2 - t1 < t3)
			{
				x = (x - t2 + t1 + L) % L;
				break;
			}
			w1.push(w1.front());
			w1.pop();	
			if (t3 > 0)
			{
				w2.push(w2.front());
				w2.pop();
				x = (y + t3) % L;
				t1 += t3;
			}
			d = 1;
		}	
	}
	return x;
}

int main()
{
	//ios_base::sync_with_stdio(false);
	//cin.tie();
	//cout.tie();		

	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	
	//~read
	scanf("%lld%lld%lld", &n, &L, &T);
	L *= 2;
	T *= 2
	for (int i = 0; i < n; i++)
		scanf("%lld%lld", &pos[i], &dir[i]), pos[i] *= 2;
	//~solve
	for (int i = 0; i < n; i++)
	{                   	
		if (dir[i] == 1)
			res[i] = (pos[i] + T) % L;
		else
			res[i] = (pos[i] - (T % L) + L) % L;
	}
	if (n == 1)
	{
		cout << res[0] / 2 << endl;
		return 0;
	}
	sort(res, res + n);
	int shift = lower_bound(pos, pos + n, go(0, L)) - pos;
	int np = (1ll * shift * (T / L)) % n;
	T %= L;
	int p1 = go(np, T);
	int p2 = go((np + 1) % n, T);
	for (int i = 0; i < n; i++)
	{
		if (res[i] == p1 && res[(i + 1) % n] == p2)
		{
			for (int j = i; j < n; j++)
				printf("%lld\n", res[j] / 2);
			for (int j = 0; j < i; j++)
				printf("%lld\n", res[j] / 2);
			return 0;			
		}
	}
	assert(false);	
	//while(true);
	return 0;
}



Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:114:15: error: expected ';' before 'for'
  114 |         T *= 2
      |               ^
      |               ;
  115 |         for (int i = 0; i < n; i++)
      |         ~~~    
a.cc:115:25: error: 'i' was not declared in this scope; did you mean 'ui'?
  115 |         for (int i = 0; i < n; i++)
      |                         ^
      |                         ui
Language: C++

#include <bits/stdc++.h>
#define newline printf ("\n")
#define space printf (" ")
#define cinfalse ios::sync_with_stdio(false)
#define fread(a) freopen (a".in", "r", stdin), freopen(a".out", "w", stdout)
#define rint register int
#define For(i, a, b) for (rint i = a; i <= b; i ++)
#define Low(i, a, b) for (rint i = a; i >= b; i --)
#define FFr(i, a, b, c) for (rint i = a; i <= b; i += c)
#define FLw(i, a, b, c) for (rint i = a; i >= b; i -= c)
#define min(a, b) ((a)>(b)?(b):(a))
#define max(a, b) ((a)>(b)?(a):(b))
#deefine ll long long
#define MAXN 100005
using namespace std;

ll c;
int x[MAXN], xx[MAXN], w[MAXN];
int l, r, s, t, n, m;
int main()
{
	scanf ("%d%d%d", &n, &l, &t);
	for (rint i = 1; i <= n; i ++) scanf ("%d%d", &x[i], &w[i]);
	for (rint i = 1; i <= n; i ++)
	{
		if (w[i] == 2) w[i] -= 3;
		r = x[i]+w[i]*t;
		if (r > 0) r+=r/l, r %= n;
		xx[i]=(r%l+l)%l;
	}
	sort (xx+1, xx+n+1);
	c = (c+n)%n;
	for (rint i = c+1; i <= n; i ++) printf ("%d\n", xx[i]);
	for (rint i = 1; i <= c; i ++) printf ("%d\n", xx[i]);
    return 0;
}


Compiler output:
a.cc:13:2: error: invalid preprocessing directive #deefine; did you mean #define?
   13 | #deefine ll long long
      |  ^~~~~~~
      |  define
a.cc:17:1: error: 'll' does not name a type
   17 | ll c;
      | ^~
a.cc: In function 'int main()':
a.cc:23:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   23 |         for (rint i = 1; i <= n; i ++) scanf ("%d%d", &x[i], &w[i]);
      |                   ^
a.cc:24:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   24 |         for (rint i = 1; i <= n; i ++)
      |                   ^
a.cc:32:9: error: 'c' was not declared in this scope
   32 |         c = (c+n)%n;
      |         ^
a.cc:33:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   33 |         for (rint i = c+1; i <= n; i ++) printf ("%d\n", xx[i]);
      |                   ^
a.cc:34:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   34 |         for (rint i = 1; i <= c; i ++) printf ("%d\n", xx[i]);
      |                   ^
Language: C++

//copy from Antiquality
//https://www.cnblogs.com/antiquality/p/9102470.html

#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=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:17:29: error: extended character 　 is not valid in an identifier
   17 |         if (a[i]%l<0) cnt--;　　　　　　　　
      |                             ^
a.cc:17:29: error: extended character 　 is not valid in an identifier
a.cc:17:29: error: extended character 　 is not valid in an identifier
a.cc:17:29: error: extended character 　 is not valid in an identifier
a.cc:17:29: error: extended character 　 is not valid in an identifier
a.cc:17:29: error: extended character 　 is not valid in an identifier
a.cc:17:29: error: extended character 　 is not valid in an identifier
a.cc:17:29: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:17:29: error: '\U00003000\U00003000\U00003000\U00003000\U00003000\U00003000\U00003000\U00003000' was not declared in this scope
   17 |         if (a[i]%l<0) cnt--;　　　　　　　　
      |                             ^~~~~~~~~~~~~~~~
Language: C++

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

int main(void) {
  scanf("%d%d%d", &n, &L, &T);
  for(int i = 1, ty; i <= n; i++) {
    scanf("%d%d", &p[i], &ty);
    if(ty == 2)
      v.push_back(make_pair(i, p[i]));
    else
      o.push_back(make_pair(i, p[i]));
    id[i] = i;
  }
  
  int lim = o.size();
  for(int i = 0; i < lim; i++) {
    tim += (2LL * T + o[i].second) / L;
    id[o[i].first] += (2LL * T + o[i].second);
    
    o.push_back(make_pair(o[i].first, (2LL * T + o[i].second) % L));
    if(o.back().second < o[i].second)
      o.back().second += L;
  }
  lim = v.size();
  for(int i = 0; i < lim; i++) {
    v.push_back(make_pair(v[i].first, v[i].second + L));
    id[v[i].first] -= tim;
  }

  for(int i = 0, j = 0, cnt = 0; i < v.size(); i++) {
    while(j < o.size() && o[j].second < v[i].second) {
      if(b[o[j].first]) {
	cnt--;
	id[o[j].first] += i;
      }
      j++;
    }
    id[v[i].first] -= cnt;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:20: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   scanf("%d%d%d", &n, &L, &T);
      |                    ^
      |                    yn
a.cc:5:24: error: 'L' was not declared in this scope
    5 |   scanf("%d%d%d", &n, &L, &T);
      |                        ^
a.cc:5:28: error: 'T' was not declared in this scope
    5 |   scanf("%d%d%d", &n, &L, &T);
      |                            ^
a.cc:7:20: error: 'p' was not declared in this scope
    7 |     scanf("%d%d", &p[i], &ty);
      |                    ^
a.cc:9:7: error: 'v' was not declared in this scope
    9 |       v.push_back(make_pair(i, p[i]));
      |       ^
a.cc:11:7: error: 'o' was not declared in this scope
   11 |       o.push_back(make_pair(i, p[i]));
      |       ^
a.cc:12:5: error: 'id' was not declared in this scope; did you mean 'i'?
   12 |     id[i] = i;
      |     ^~
      |     i
a.cc:15:13: error: 'o' was not declared in this scope
   15 |   int lim = o.size();
      |             ^
a.cc:17:5: error: 'tim' was not declared in this scope; did you mean 'lim'?
   17 |     tim += (2LL * T + o[i].second) / L;
      |     ^~~
      |     lim
a.cc:18:5: error: 'id' was not declared in this scope; did you mean 'i'?
   18 |     id[o[i].first] += (2LL * T + o[i].second);
      |     ^~
      |     i
a.cc:24:9: error: 'v' was not declared in this scope
   24 |   lim = v.size();
      |         ^
a.cc:27:5: error: 'id' was not declared in this scope; did you mean 'i'?
   27 |     id[v[i].first] -= tim;
      |     ^~
      |     i
a.cc:27:23: error: 'tim' was not declared in this scope; did you mean 'lim'?
   27 |     id[v[i].first] -= tim;
      |                       ^~~
      |                       lim
a.cc:32:10: error: 'b' was not declared in this scope
   32 |       if(b[o[j].first]) {
      |          ^
a.cc:34:9: error: 'id' was not declared in this scope; did you mean 'i'?
   34 |         id[o[j].first] += i;
      |         ^~
      |         i
a.cc:38:5: error: 'id' was not declared in this scope; did you mean 'i'?
   38 |     id[v[i].first] -= cnt;
      |     ^~
      |     i
Language: C++

#include<iostream>
#include<vector>

using namespace std;

struct p{
  long long first;
  int w;

  bool operator<(const p & right) const {
    return first == right.first ? w < right.w : first < right.first;
  }
};

int main(){
  long long n, l, t; cin >> n >> l >> t;
  vector< p > x(n);
  for(int i = 0 ; i < n; i++){
    cin >> x[i].first >> x[i].w;
  }
  long long stand = 0;
  for(long long i = 0 ; i < n ; i++){
    if(x[i].w == 1){
      stand += (x[i].first + t) / l;
      x[i].first = (x[i].first + t)%l;
    }
    else if(x[i].w == 2){
      stand -= (l - x[i].first  + t - 1) / l;
      x[i].first = (x[i].first + l - t%l) % l;
    }
  }
  sort(x.begin(), x.end());
  for(long long i = 0 ; i < n ; i++) cout << stand << x[i].first << endl;
  for(long long i = 0 ; i < n ; i++){
    if(stand >= 0) cout << x[(i + stand%n)%n].first << endl;
    if(stand < 0)cout << x[(i + n - (-1*stand)%n) % n].first << endl;
  }
}


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

#include<bits/stdc++.h>
using namespace std;
int amin()
{
	int a,b,c,n[1001],m[1001];
	cin>>a>>b>>c;
	for(int i=1;i<=a;i++)
	  cin>>n[i]>>m[i];
	if(b==8)
	{
	cout<<"1"<<endl;
	cout<<"3"<<endl;
	cout<<"0"<<endl;
    }
    else if(b==20)
    {
    	cout<<"7"<<endl;
    	cout<<"18"<<endl;
    	cout<<"18"<<endl;
    	cout<<"1"<<endl;
	}
	return 0;
}

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

#include<cstdio>
#include<math.h>
#include<algorithm>
#include<vector>
#include<queue>
 
using namespace std;
#define rep(i,n) for(long long int i=0;i<n;i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define mp make_pair
#define LLIandI pair<long long int , int>
/*
 1≤N≤10^5
1≤L≤10^9
1≤T≤10^9
0≤X1<X2<…<XN≤L−1
1≤Wi≤2
Wi が 1 なら時計回りに、Wi が 2 なら反時計回りに動き始めます
v=1
 */
 
int main(){
    long long int N,L,T;
    scanf("%lld %lld %lld",&N,&L,&T);
    long long int X[100002],W[100002];
    vector<long long int> hit_one;
    rep(i,N){
        scanf("%lld %lld",&X[i],&W[i]);
        if(W[i]==1)W[i]=+1;
        if(W[i]==2)W[i]=-1;
        if(W[i]*W[0]<0)hit_one.push_back(i);
    }
    long long int list_ans[100002];
    rep(i,N){
        long long miniT=T%L;
        list_ans[i]=( ( (X[i]+W[i]*miniT)%L)+L)%L;
    }
    long long int zero_to_what=0;//0だと思われている座標は実際にはzero_to_what
    rep(i,hit_one.size()){
        long long int kyori;
        if(W[0]==1)kyori=abs(X[hit_one[i]]-X[0]);
        else kyori=X[0]+(L-X[hit_one[i]]);
        if(2*T>=kyori)zero_to_what+= ( ((2*T-kyori)/L)+1 );
    }
    zero_to_what=( (zero_to_what%N*W[0])+N)%N;
    long long int zero_to_what_x=list_ans[0];//0だと思われているが実際にはzero_to_whatであるものの座標
    sort(list_ans,list_ans+N);
    zero_to_what_x=lower_bound(list_ans,list_ans+N,zero_to_what_x)-list_ans;//zero_to_what_xのindex
if(i<N-1&&list_ans[zero_to_what_x]==list_ans[zero_to_what_x+1]){
if(W[0])zero_to_what_x+=1;
}
    //つまりzero_to_what+iの座標はlist_ans[zero_to_what_x+i]
    rep(i,N){
        printf("%lld\n",list_ans[(zero_to_what_x+i-zero_to_what+N)%N]);
    }
   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:4: error: 'i' was not declared in this scope
   50 | if(i<N-1&&list_ans[zero_to_what_x]==list_ans[zero_to_what_x+1]){
      |    ^
Language: C++

#include<algorithm>
#include<iostream>
using namespace std;
int a[100035],n,l,t,x,cnt;
int main(){
	cin>>n>>l>>t;
    for(int i=1;i<=n;i++){
    	cin>>a[i]>>x;
        a[i]+=((x==1)?t:-t);
        cnt+=a[i]/l;
        if(a[i]%l<0){
			cnt--;　　　　　　　　//就是这里细节的处理
		}
        ((a[i]%=l)+=l)%=l;
    }
    sort(a+1,a+n+1);
    ((cnt%=n)+=n)%=n;
    for(int i=cnt+1;i<=n;i++){
    	cout<<a[i]<<endl;
    }
    for(int i=1;i<=cnt;i++){
    	cout<<a[i]<<endl;
    }
    return 0;
}

Compiler output:
a.cc:12:31: error: extended character 　 is not valid in an identifier
   12 |                         cnt--;　　　　　　　　//就是这里细节的处理
      |                               ^
a.cc:12:31: error: extended character 　 is not valid in an identifier
a.cc:12:31: error: extended character 　 is not valid in an identifier
a.cc:12:31: error: extended character 　 is not valid in an identifier
a.cc:12:31: error: extended character 　 is not valid in an identifier
a.cc:12:31: error: extended character 　 is not valid in an identifier
a.cc:12:31: error: extended character 　 is not valid in an identifier
a.cc:12:31: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:12:31: error: '\U00003000\U00003000\U00003000\U00003000\U00003000\U00003000\U00003000\U00003000' was not declared in this scope
   12 |                         cnt--;　　　　　　　　//就是这里细节的处理
      |                               ^~~~~~~~~~~~~~~~
Language: C++

object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val Array(n, l, t) = readLine().split(" ").map(_.toInt)
    val ants = (1 to n).map(i => {
      val Array(x, w) = readLine().split(" ").map(_.toInt)
      Ant(i, x * 2, if (w == 1) Positive else Negative)
    })
    f(l, t * 2, ants).foreach(ant => println(ant.x / 2))
  }

  // t, x は実際の２倍
  // ants は x でソート済み
  def f(l: Int, t: Int, ants: IndexedSeq[Ant]): Seq[Ant] = {
    val time = (ants.sliding(2) ++ Some(List(ants.last, ants.head.copy(x = ants.head.x + l * 2))))
      .filter { case Seq(a1, a2) => a1.d == Positive && a2.d == Negative }
      .map { case Seq(a1, a2) => a2.x - a1.x }
      .min

    if (time < t) {
      f(l, t - time, ants.map(_.after(time, l)).sorted)
    } else {
      ants.map(_.after(t, l)).sortBy(_.i)
    }
  }

}


sealed trait Direction

object Positive extends Direction

object Negative extends Direction

case class Ant(i: Int, x: Int, d: Direction) extends Ordered[Ant] {
  def after(t: Int, l: Int): Ant = {
    val nextX = this.x + t
    if (2 * l <= nextX) {
      this.copy(x = nextX - 2 * l)
    } else {
      this.copy(x = nextX)
    }
  }

  override def compare(that: Ant): Int = {
    if (this.x < that.x) {
      -1
    } else if (that.x < this.x) {
      1
    } else {
      if (this.d == that.d) {
        0
      } else if (this.d == Positive) {
        1
      } else {
        -1
      }
    }
  }
}


Compiler output:
a.cc:1:1: error: 'object' does not name a type
    1 | object Main {
      | ^~~~~~
a.cc:30:1: error: 'sealed' does not name a type
   30 | sealed trait Direction
      | ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric> //accumulate
using ll = long long;
using namespace std;

int main() {
    ll n, l, t;
    cin >> n >> l >> t;
    vector<ll> x(n), w(n);
    for (int i = 0; i < n; i++){
        cin >> x[i] >> w[i];
    }
    int wr = 0;
    for (int i = 1; i < n; i++){
        if (w[i] != w[0]) wr += 1;
    }

    ll count = 0;
    ll dis = 2 * t;

    if (w[0] == 1){
        count += wr * (dis/l);
    }
    else count -= wr * (dis/l);
    dis -= (dis/l) * l;

    if (w[0] == 1){
        for (int i = 1; i < n; i ++){
            if (x[i] - x[0] <= dis && w[i] != w[0]){
                count += 1;
            }
        }
    }
    else{
        for (int i = 1; i < n; i++){
            if (x[0] + (l - x[i]) <= dis && w[i] != w[0]){
                count -= 1;
            }
        }
    }

    count = (count + n * 2 * t) % n;

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

    int j = 0;

    for (int i = 0; i < n; i++){
        if (y[i] == x_1 && w[0] == 2){
            j = i;
            break;
        }
        elif (y[i] == x_1) j = i;
    }
    j = (j - count + n) % n;
    for (int i = j; i < n; i++){
        cout << y[i] << endl;
    }
    for (int i = 0; i < j; i++){
        cout << y[i] << endl;
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:62:9: error: 'elif' was not declared in this scope
   62 |         elif (y[i] == x_1) j = i;
      |         ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric> //accumulate
using ll = long long;
using namespace std;

int main() {
    ll n, l, t;
    cin >> n >> l >> t;
    vector<ll> x(n), w(n);
    for (int i = 0; i < n; i++){
        cin >> x[i] >> w[i];
    }
    int wr = 0;
    for (int i = 1; i < n; i++){
        if (w[i] != w[0]) wr += 1;
    }

    ll count = 0;
    ll dis = 2 * t;

    if (w[0] == 1){
        count += wr * (dis/l);
    }
    else count -= wr * (dis/l);
    dis -= (dis/l) * l;

    if (w[0] == 1){
        for (int i = 1; i < n; i ++){
            if (x[i] - x[0] <= dis && w[i] != w[0]){
                count += 1;
            }
        }
    }
    else{
        for (int i = 1; i < n; i++){
            if (x[0] + (l - x[i]) <= dis && w[i] != w[0]){
                count -= 1;
            }
        }
    }

    count = (count + n * 2 * t) % n;

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

    int j = 0;

    for (int i = 0; i < n; i++){
        if (y[i] == x_1 && w[0] == 2){
            j = i;
            break;
        elseif (y[i] == x_1) j = i;
        }
    }
    j = (j - count + n) % n;
    for (int i = j; i < n; i++){
        cout << y[i] << endl;
    }
    for (int i = 0; i < j; i++){
        cout << y[i] << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:9: error: 'elseif' was not declared in this scope
   61 |         elseif (y[i] == x_1) j = i;
      |         ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric> //accumulate
using ll = long long;
using namespace std;

int main() {
    ll n, l, t;
    cin >> n >> l >> t;
    vector<ll> x(n), w(n);
    for (int i = 0; i < n; i++){
        cin >> x[i] >> w[i];
    }
    int wr = 0;
    for (int i = 1; i < n; i++){
        if (w[i] != w[0]) wr += 1;
    }

    ll count = 0;
    ll dis = 2 * t;

    if (w[0] == 1){
        count += wr * (dis/l);
    }
    else count -= wr * (dis/l);
    dis -= (dis/l) * l;

    if (w[0] == 1){
        for (int i = 1; i < n; i ++){
            if (x[i] - x[0] <= dis && w[i] != w[0]){
                count += 1;
            }
        }
    }
    else{
        for (int i = 1; i < n; i++){
            if (x[0] + (l - x[i]) <= dis && w[i] != w[0]){
                count -= 1;
            }
        }
    }

    count = (count + n * 2 * t) % n;

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

    int j = 0;

    for (int i = 0; i < n; i++){
        if (y[i] == x_1 && w[0] == 2){
            j = i;
            break;
        elif (y[i] == x_1) j = i;
        }
    }
    j = (j - count + n) % n;
    for (int i = j; i < n; i++){
        cout << y[i] << endl;
    }
    for (int i = 0; i < j; i++){
        cout << y[i] << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:9: error: 'elif' was not declared in this scope
   61 |         elif (y[i] == x_1) j = i;
      |         ^~~~
Language: C++

#include<iostream>

using namespace std;

typedef long long ll;

int main() {
    ll n,l,t;
    cin >> n >> l >> t;
    l *= 2;
    t *= 2;
    ll x[n], w[n], y[n];
    for(int i=0;i<n;i++){
        cin >> x[i] >> w[i];
        x[i] *= 2;
        if(w[i] == 1){
            y[i] = (x[i] + t) % l;
        }else{
            y[i] = (x[i] - t + (t-x[i]+l-1)/l*l) % l;
        }
    }
    sort(y, y+n);

    ll i0 = 0LL;
    for(int i=1;i<n;i++){
        if(w[0] == w[i]) continue;
        if(w[0] == 1){
            if(((x[i]-x[0]+l)%l)/2 > t) continue;
            ll tt = t - ((x[i]-x[0]+l)%l)/2;
            i0 += tt/l + 1LL;
        }else{
            if(((x[0]-x[i]+l)%l)/2 > t) continue;
            ll tt = t - ((x[0]-x[i]+l)%l)/2;
            i0 -= tt/l + 1LL;
            if(i0 < 0LL) i0 += (-i0+n-1)/n * n;
        }
    }

    for(int i=0;i<n;i++){
        cout << y[(i+i0)%n]/2 << endl;
    }
}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define FORR(I,A,B) for(ll I = (B-1); I >= (A); --I)
const ll INF=1e18+7;
const ll MOD=1e9+7;


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n,l,t;
	cin>>n>>l>>t;
	vector<ll> ans(n);
	ll pass0 = 0;
	FOR(i,0,n){
		ll x,c;
		cin >> x >> c;
		if(c==2)c=-1;
		c *= t;
		x+=c;
		pass0 += x/l;
		if(x=<0)pass0--;
		x %= l;
		if(x<0)x+=l;
		ans[i] = x;
	}
	sort(ans.begin(),ans.end());
	FOR(i,0,n){
		cout<<ans[((i+pass0)%n+n)%n]<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:22: error: expected primary-expression before '<' token
   25 |                 if(x=<0)pass0--;
      |                      ^
Language: C++

#include <cstdio>
#include <vector>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()

using ll = long long;

ll N, L, T;
std::vector<ll> vs;
ll cnt;

int main()
{
  scanf( "%lld%lld%lld", &N, &L, &T );
  rep( i, N )
  {
    ll X, W;
    scanf( "%lld%lld", &X, &W );

    if( W == 1 )
    {
      vs.emplace_back( (X+T)%L );
      cnt -= (T-(L-X)+L)/L;
    }
    else
    {
      vs.emplace_back( (X-T+L)%L );
      
      cnt += (T-(X+1)+L)/L;
    }
  }

  cnt = (cnt%N+N)%N;

  std::sort( all(vs) );

  rep( i, N )
    printf( "%lld\n", vs[(i-cnt+N)%N]);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:8: error: 'sort' is not a member of 'std'
   36 |   std::sort( all(vs) );
      |        ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <functional>
#include <string>
#include <stack>
#include <set>
#include <sstream>
#include <iomanip>
#include <limits>
#include <cstring>

using namespace std;
using ll = long long;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<double, double >pd;
typedef pair<string, string> sP;
typedef pair<ll, pair<ll, ll>> PP;


const ll mod = 1e4;
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1 << 30;
const ll INF2 = 9e18;
const double INF3 = 9e14;
const double eps = 1e-10;
const double PI = 3.14159265358979323846;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
const int tx[8] = { -1,0,1,-1,1,-1,0,1 }, ty[8] = { -1,-1,-1,0,0,1,1,1 };

#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define pb push_back
#define eb emplace_back
#define fr first
#define sc second

ll n, p[200010], cnt, l, t, x[200010];
vector<ll>place;


int main() {
	cin >> n >> l >> t;
	for (int i = 0;i < n;i++) {
		cin >> x[i] >> p[i];
	}

	for (int i = 0;i < n;i++) {//最終的な蟻の位置を求める
		if (p[i] == 1) {
			place.eb((x[i] + t) % l);
		}
		else {
			place.eb((x[i] - t + l * (ll)1e8) % l);
		}
	}
	sort(ALL(place));

	for (int i = 0;i < n;i++) {
		if (p[i] == 1) {
			cnt += (x[i] + t) / l;
		}
		else {
			cnt += (x[i] - t  - (l - 1)) / l;
		}
	}
	
	ll it1 = (cnt+n) % n;
	for (int i = it1;i < it1 + n;i++) {
		cout << place[(i+n)%n] << endl
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:47: error: expected ';' before '}' token
   74 |                 cout << place[(i+n)%n] << endl
      |                                               ^
      |                                               ;
   75 |         }
      |         ~
Language: C++

#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <stack>
#include <fstream>
#include <cstdint>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
#include <functional>
using namespace std;
typedef int64_t ll;
typedef uint64_t ull;
constexpr uint64_t L1 = 1ull;
constexpr ull bit(int n){ return 1ull << n;}

// for(auto && i : Range(l,r))
// -> i = [l..r)
class Range {
private: struct It{ int x; int operator*(){return x;}
 bool operator!=(It& lhs){ return x<lhs.x;} void operator++(){++x;} }; It l,r;
public: Range(int n):l({0}),r({n}){} Range(int i,int n):l({i}),r({n})
 {}It& begin(){return l;} It& end(){return r;} };

void solve(istream& cin) {
    ll N, L, T;
    while(cin >> N >> L >> T){
        vector<ll> V, W;
        for (int i = 0; i < N; ++i) {
            int tmp;
            cin >> tmp;
            V.push_back(tmp);
            cin >> tmp;
            W.push_back(tmp == 1 ? 1 : -1);
        }
        ll col_n = 0;
        for (int i = 1; i < N; ++i) {
            if(W[0] != W[i]){
                ll tcol = -W[0] * V[0] - W[i] * V[i];
                tcol = (tcol + L) % L;
                tcol /= T;
                col_n += tcol;
            }
        }
        ll num0 = (W[0] * col_n);
        num0 = (num0 + 1000000ll*N) % N;
        ll ls0 = (V[0] + W[0] * T + 1000000000*L) % L;
        vector<ll> last;
        last.push_back(ls0);
        for (int i = 1; i < V.size(); ++i) {
            last.push_back((V[i] + W[i] * T + 1000000000*L) % L);
//            cerr << "last[" << i << "] :" << last.back() << endl;
        }
        sort(last.begin(), last.end());
        vector<ll> ans(N);
        auto pos0l = lower_bound(last.begin(), last.end(), ls0);
        auto pos0u = upper_bound(last.begin(), last.end(), ls0);
        if(pos0u - pos0l == 2){
            if(W[0] == -1){
                num0++;
            }
        }
        for (int i = 0; i < N; ++i) {
            ans[(i+num0) % N] = *pos0l;
            pos0l++;
            if(pos0l == last.end()) pos0l = last.begin();
        }
        for (int i = 0; i < N; ++i) {
            cout << ans.at(i) << '\n';
        }
    }
}

int main(int argc, char *argv[]) {
    string FileName("AGC013C"), Modifier("MEPH_");
    string ExecutionName = Modifier + FileName;
    string sub(argv[0]);
    if(sub.size() > ExecutionName.size())
        sub = sub.substr(sub.size()-ExecutionName.size(), ExecutionName.size());
    cerr << sub << endl;
    if (sub != ExecutionName) 
        cin.tie(0);
        ios::sync_with_stdio(false);
        solve(cin);
    }
    else {
        string inFile = "sample.txt";
        auto fs = fstream(inFile, fstream::in);
        solve(fs);
    }
}

Compiler output:
a.cc:90:5: error: expected unqualified-id before 'else'
   90 |     else {
      |     ^~~~
a.cc:95:1: error: expected declaration before '}' token
   95 | }
      | ^
Language: Java

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class ACG_013C {






	public static void main(String[]args) throws Throwable {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = sc.nextInt();
		long l = sc.nextLong();
		long t = sc.nextLong();
		long p[] = new long[n];
		long cw[] = new long[n];
		long end[] = new long[n];
		for (int i = 0 ; i < n ; ++i) {
			p[i] = sc.nextInt(); int c = sc.nextInt() - 1;
			cw[i] = c;
			int sign = (c == 0) ? 1 : -1;
			end[i] = (p[i] + t*sign ) % l;
			while (end[i] < 0) end[i] += l;
			end[i] %= l;
		}
		long col = 0;
		if (cw[0] == 0) {
			for (int i = 1 ; i < n ; ++i) {
				if (cw[i] == cw[0]) {
					continue;
				}
				long has = 2 * t;
				long d = p[i] - p[0];
				if (has >= d) {
					++col;
					has -= d;
					col += has / l;
					col %=n;
				}
			}
		} else {
			for (int i = 1 ; i < n ; ++i) {
				if (cw[i] == cw[0]) {
					continue;
				}
				long has = 2 * t;
				long d = l - p[i] + p[0];
				if (has >= d) {
					--col;
					has -= d;
					col -= has / l;
					col %= n;
				}

			}
		}
		Arrays.sort(end);
		while (col < 0) col += n;
		col %= n;
		int pos = (int)(col);
		
		for (int i = pos ; i < n ; ++i) out.print(end[i]+"\n");
		for (int i = 0 ; i < pos ; ++i) out.print(end[i]+"\n");
		out.flush();
		out.close();
	}
	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}


}


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

#include<bits/stdc++.h>

int a[100035],n,l,t,x,y;
long long cnt;

int main()
{
    scanf("%d%d%d",&n,&l,&t);
    for (int i=1; i<=n; i++)
    {
        scanf("%d%d",&x,&y);
        if (y==1){
            x += t;
            cnt += x/l;
            x %= l;
        }else{
            cnt += (x-t)/l;
            x = (x-t)%l;
            if (x < 0) cnt--, x += l;
        }
        a[i] = x;
    }
    std::sort(a+1, a+n+1);
    ((cnt%=n)+n)%=n;
    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: In function 'int main()':
a.cc:24:14: error: lvalue required as left operand of assignment
   24 |     ((cnt%=n)+n)%=n;
      |     ~~~~~~~~~^~~
Language: C++

#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;
#define maxn 200005
 typedef long long ll;
ll l,n,T,x[200005];
ll w[200005],t[200005];
ll sum[200005],ans[200005];
ll f(ll x){
  while(x<0)x+=l;
  return x%l;
}
ll calc(int left,int right,int p){
  if(p==1)return sum[right]-sum[left];
  else return (right-left)-(sum[right]-sum[left]);
}
 void solve(){
  ll o=T*2/l;
  ll nt=T*2%l;
  int h=0;
  for(int i=0;i<n;i++){
    if(w[i]==2)continue;
    ll key=i;
    key+=o*(n-sum[n]);
    while(h<n+n&&(w[h]==1||x[h]-x[i]<=nt))h++;
    key+=calc(i,h,2);
    key%=n;
    ans[key]=t[i];
  }
  h=n+n-1;
  for(int i=n+n-1;i>=n;i--){
    if(w[i]==1)continue;
    ll key=i;
    key+= n-(o*(sum[n]) )%n;
    while(h>=0&&(w[h]==2||x[i]-x[h]<=nt))h--;
    key+=(n-calc(h+1,i,1))%n;
    key%=n;
    ans[key]=t[i];
  }
}
 int main(){
  memset(ans,-1,sizeof(ans));
  cin>>n>>l>>T; 
  for(int i=0;i<n;i++){
    cin>>x[i]>>w[i]; 
    if(w[i]==1){
      t[i]=x[i]+T;
    } else{
      t[i]=x[i]-T;
    }
    t[i]=f(t[i]);
  }
  
  for(int i=0;i<n;i++){
    x[i+n]=x[i]+l;
    w[i+n]=w[i];
    t[i+n]=t[i];
  }
  for(int i=1;i<=n*2;i++){
    sum[i]=sum[i-1];
    if(w[i-1]==1)sum[i]++;
  }
  solve();
 for(int i=0;i<n;i++)
    cout<<ans[i]<<endl;
  return 0;
}

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

#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>

using namespace std;

int main()
{
	int n, w[100001];
	long long int l, t, x[100001], y[100001];
	scanf("%d %lld %lld", &n, &l, &t);
	l=l*2;
	t=t*2;
	vector<int> i1, i2;
	int e1=0, e2=0;
	for(int i=0; i<n; i++){
		scanf("%lld %d", &x[i], &w[i]);
		x[i]=x[i]*2;
		if(w[i]==1){
			y[i]=(x[i]+t)%l;
			i1.push_back(i);
			e1=1;
		}else{
          if(x[i]+l-t>=0){
			y[i]=(x[i]+l-t)%l;
          }else{
            y[i]=(l-(-(x[i]+l-t))%l)%l;
			i2.push_back(i);
			e2=1;
		}
	}
	if(e1==0 || e2==0){
		for(int i=0; i<n; i++){
			printf("%lld\n", y[i]/2);
		}
	}else if(w[0]==1){
		long long int n2=i2.size();
		long long int t0[200002];
		for(int i=1; i<=n2; i++){
			t0[i]=(x[i2[i-1]]-x[0])/2;
		}
		for(int i=n2+1; i<=2*n2; i++){
			t0[i]=(x[i2[i-n2-1]]-x[0]+l)/2;
		}
		long long int tq=t/l, tr=t%l;
		long long int k;
		for(int i=1; i<2*n2; i++){
			if(t0[i]<=tr && tr<t0[i+1]) k=i;
		}
		if(tr<t0[1]) k=0;
		if(tr>=t0[2*n2]) k=2*n2;
		k=(tq*2*n2+k)%n;
		long long int ans[100000];
		long long int y0=y[0];
		ans[k]=y0/2;
		sort(y, y+n);
		int k1;
		for(int i=0; i<n; i++){
			if(y[i]==y0)  k1=i;
		}
		if(k1==n-1 && y[0]==y0) k1=0;
		for(int i=0; i<n; i++){
			int p=i+k, q=i+k1;
			if(p>=n) p=p-n;
			if(q>=n) q=q-n;
			ans[p]=y[q]/2;
		}
		for(int i=0; i<n; i++){
			printf("%lld\n", ans[i]);
		}
	}else{
		long long int n1=i1.size();
		long long int t0[200002];
		for(int i=1; i<=n1; i++){
			t0[i]=(l-x[i1[n1-i]]+x[0])/2;
		}
		for(int i=n1+1; i<=2*n1; i++){
			t0[i]=(l-x[i1[2*n1-i]]+x[0]+l)/2;
		}
		long long int tq=t/l, tr=t%l;
		long long int k;
		for(int i=1; i<2*n1; i++){
			if(t0[i]<=tr && tr<t0[i+1]) k=n-i;
		}
		if(tr<t0[1]) k=0;
		if(tr>=t0[2*n1]) k=n-2*n1;
		k=(n+k+2*(n-n1)*tq)%n;
		long long int ans[100000];
		long long int y0=y[0];
		ans[k]=y0/2;
		sort(y, y+n);
		int k1;
		for(int i=0; i<n; i++){
			if(y[i]==y0){
				k1=i;
				break;
			}
		}
		if(k1==0 && y[n-1]==y0) k1=n-1;
		for(int i=0; i<n; i++){
			int p=i+k, q=i+k1;
			if(p>=n) p=p-n;
			if(q>=n) q=q-n;
			ans[p]=y[q]/2;
		}
		for(int i=0; i<n; i++){
			printf("%lld\n", ans[i]);
		}
	}
	return 0;
}

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


    //1番の蟻の動きと他の蟻の位置
    REP(i,2*t){
        //cout<<"time "<<i*0.5+0.5<<endl;
        fx = return_position(fx,fw,l);
        REP(j,n){
            x[j] = return_position(x[j],w[j],l);
            n_a[x[j]*2]++;
            //cout<<j<<"th aunt position "<<x[j]<<endl;
        }
        if (n_a[fx*2]==2){
            fw = fw + (1.5 - fw)*2;
        }
        REP(i,2*l){
            //cout<<"number of aunts in position"<<i*0.5<<" "<<n_a[i]<<endl;
            n_a[i]=0;
        }
        //cout<<fx<<"\t"<<fw<<"\t"<<i*0.5+0.5<<endl;
    }
    sort(all(x));

    REP(i,n){
        if (x[i]==fx){
            flag=1;
        }
        if (flag==1){
            cout<<x[i]<<"\n";
        }
    }
    REP(i,n){
        if (x[i]==fx){
            break;
        }
        cout<<x[i]<<"\n";
    }
    return 0;
}

Compiler output:
a.cc:3:8: error: expected constructor, destructor, or type conversion before '(' token
    3 |     REP(i,2*t){
      |        ^
a.cc:20:9: error: expected constructor, destructor, or type conversion before '(' token
   20 |     sort(all(x));
      |         ^
a.cc:22:8: error: expected constructor, destructor, or type conversion before '(' token
   22 |     REP(i,n){
      |        ^
a.cc:30:8: error: expected constructor, destructor, or type conversion before '(' token
   30 |     REP(i,n){
      |        ^
a.cc:36:5: error: expected unqualified-id before 'return'
   36 |     return 0;
      |     ^~~~~~
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n,m) for (int i=n; i<m; i++)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
#define possible(n) cout << ((n) ? "possible" : "impossible"  ) << endl
#define Size(n) (n).size()

float return_position(float x,float w, int l){
    x = x + 1.5 - w;
    if (x<0){
        x = x + (float)l;
    }
    if (x>=l){
        x = x - (float)l;
    }
    return x;
}

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

	int n,l,t,a,b,flag=0;
    float fx,fw;
    vector<float> x,w;

	cin>>n>>l>>t;
    vector<int> n_a(2*l,0);

    REP(i,n){
        cin>>a>>b;
        x.push_back(a);
        w.push_back(b);
    }

    fx = x[0];
    fw = w[0];
:
    //1番の蟻の動きと他の蟻の位置
    REP(i,2*t){
        //cout<<"time "<<i*0.5+0.5<<endl;
        fx = return_position(fx,fw,l);
        REP(j,n){
            x[j] = return_position(x[j],w[j],l);
            n_a[x[j]*2]++;
            //cout<<j<<"th aunt position "<<x[j]<<endl;
        }
        if (n_a[fx*2]==2){
            fw = fw + (1.5 - fw)*2;
        }
        REP(i,2*l){
            //cout<<"number of aunts in position"<<i*0.5<<" "<<n_a[i]<<endl;
            n_a[i]=0;
        }
        //cout<<fx<<"\t"<<fw<<"\t"<<i*0.5+0.5<<endl;
    }
    sort(all(x));

    REP(i,n){
        if (x[i]==fx){
            flag=1;
        }
        if (flag==1){
            cout<<x[i]<<"\n";
        }
    }
    REP(i,n){
        if (x[i]==fx){
            break;
        }
        cout<<x[i]<<"\n";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:1: error: expected primary-expression before ':' token
   46 | :
      | ^
a.cc:48:9: error: 'i' was not declared in this scope
   48 |     REP(i,2*t){
      |         ^
a.cc:3:30: note: in definition of macro 'REP'
    3 | #define REP(i,n) for(int i=0;i<n;i++)
      |                              ^