Language: C++

int main(void){
	llint N,L,T,i,j,a,b;
	vector<llint> ant;
	vector<llint> muki;
	vector<llint> gont;
	scanf("%lld %lld %lld",&N,&L,&T);
	gont.resize(N);
	for(i=0;i<N;i++){
		scanf("%lld %lld",&a,&b);
		ant.pub(a);
		muki.pub(b);
	}
	if(muki[0]==1){
		a=1;b=0;j=0;//aはアリ　ｂは答え jは周回
		while(-1){
			if(ant[0]+2*T<=ant[a]+j*L){break;}
			if(muki[0]!=muki[a]){b++;}
			a++;
			if(a>=N){a-=N;j++;}
		}
	} else{
		a=N-1;b=0;j=-1;//aはアリ　ｂは答え jは周回
		while(-1){
			if(ant[0]-2*T>ant[a]+j*L){break;}
			if(muki[0]!=muki[a]){b--;}
			a--;
			if(a<0){a+=N;j--;}
		}
	}
	//ant[N-b]が本物の0番
	for(i=0;i<N;i++){
		if(muki[i]==1){gont[i]=(((L+ant[i]+T)%L)+L)%L;}
		else{gont[i]=(((L+ant[i]-T)%L)+L)%L;}
	}
	a=gont[0];
	sort(gont.begin(),gont.end());
	int hon=lower_bound(gont.begin(),gont.end(),a)-gont.begin();
	b=(hon-b+N)%N;//これが本当の0
	for(i=0;i<N;i++){
		printf("%lld\n",gont[b]);
		b++;
		b%=N;
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:2:9: error: 'llint' was not declared in this scope; did you mean 'int'?
    2 |         llint N,L,T,i,j,a,b;
      |         ^~~~~
      |         int
a.cc:3:9: error: 'vector' was not declared in this scope
    3 |         vector<llint> ant;
      |         ^~~~~~
a.cc:3:23: error: 'ant' was not declared in this scope; did you mean 'int'?
    3 |         vector<llint> ant;
      |                       ^~~
      |                       int
a.cc:4:23: error: 'muki' was not declared in this scope
    4 |         vector<llint> muki;
      |                       ^~~~
a.cc:5:23: error: 'gont' was not declared in this scope
    5 |         vector<llint> gont;
      |                       ^~~~
a.cc:6:33: error: 'N' was not declared in this scope
    6 |         scanf("%lld %lld %lld",&N,&L,&T);
      |                                 ^
a.cc:6:36: error: 'L' was not declared in this scope
    6 |         scanf("%lld %lld %lld",&N,&L,&T);
      |                                    ^
a.cc:6:39: error: 'T' was not declared in this scope
    6 |         scanf("%lld %lld %lld",&N,&L,&T);
      |                                       ^
a.cc:6:9: error: 'scanf' was not declared in this scope
    6 |         scanf("%lld %lld %lld",&N,&L,&T);
      |         ^~~~~
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         for(i=0;i<N;i++){
      |             ^
a.cc:9:36: error: 'a' was not declared in this scope
    9 |                 scanf("%lld %lld",&a,&b);
      |                                    ^
a.cc:9:39: error: 'b' was not declared in this scope
    9 |                 scanf("%lld %lld",&a,&b);
      |                                       ^
a.cc:14:17: error: 'a' was not declared in this scope
   14 |                 a=1;b=0;j=0;//aはアリ　ｂは答え jは周回
      |                 ^
a.cc:14:21: error: 'b' was not declared in this scope
   14 |                 a=1;b=0;j=0;//aはアリ　ｂは答え jは周回
      |                     ^
a.cc:14:25: error: 'j' was not declared in this scope
   14 |                 a=1;b=0;j=0;//aはアリ　ｂは答え jは周回
      |                         ^
a.cc:22:17: error: 'a' was not declared in this scope
   22 |                 a=N-1;b=0;j=-1;//aはアリ　ｂは答え jは周回
      |                 ^
a.cc:22:23: error: 'b' was not declared in this scope
   22 |                 a=N-1;b=0;j=-1;//aはアリ　ｂは答え jは周回
      |                       ^
a.cc:22:27: error: 'j' was not declared in this scope
   22 |                 a=N-1;b=0;j=-1;//aはアリ　ｂは答え jは周回
      |                           ^
a.cc:31:13: error: 'i' was not declared in this scope
   31 |         for(i=0;i<N;i++){
      |             ^
a.cc:35:9: error: 'a' was not declared in this scope
   35 |         a=gont[0];
      |         ^
a.cc:36:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   36 |         sort(gont.begin(),gont.end());
      |         ^~~~
      |         short
a.cc:37:17: error: 'lower_bound' was not declared in this scope
   37 |         int hon=lower_bound(gont.begin(),gont.end(),a)-gont.begin();
      |                 ^~~~~~~~~~~
a.cc:38:9: error: 'b' was not declared in this scope
   38 |         b=(hon-b+N)%N;//これが本当の0
      |         ^
a.cc:39:13: error: 'i' was not declared in this scope
   39 |         for(i=0;i<N;i++){
      |             ^
a.cc:40:17: error: 'printf' was not declared in this scope
   40 |                 printf("%lld\n",gont[b]);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void){