Language: C++

int main() {
  std::cin.tie(0); std::ios::sync_with_stdio(false);
  int N; double L, T; std::cin >> N >> L >> T;
  std::vector<double> x(N), v(N), a(N);
  T -= 1.0/16.0;
  for(int i = 0; i < N; ++i) {
    int X, W; std::cin >> X >> W;
    x[i] = X;
    if(W == 1) {
      v[i] = 1.0;
      a[i] = std::fmod(x[i] + T, L);
    } else {
      v[i] = -1.0;
      a[i] = std::fmod(x[i] - T, L);
      a[i] = std::fmod(a[i]+L, L);
    }
  }
  double p0 = a[0];
  std::sort(a.begin(), a.end());
  int n0 = 0;
  if(v[0] > 0) {
    for(int i = 1; i < N; ++i) if(v[0]+v[i] == 0) {
      if(T+T > x[i]-x[0]) {
        double t = T+T-(x[i]-x[0]);
        (n0 += 1+int(t/L)) %= N;
      }
    }
  } else for(int i = 1; i < N; ++i) if(v[0]+v[i] == 0) {
    if(T+T > L - (x[i]-x[0])) {
      double t = T+T-(L-(x[i]-x[0]));
      (n0 -= 1+int(t/L)) %= N;
      (n0 += N) %= N;
    }
  }
  int i0 = std::lower_bound(a.begin(), a.end(), p0) - a.begin();
  (i0 += N-n0) %= N;
  for(int i = 0; i < N; ++i) {
    std::cout << int(a[(i0+i)%N]+1.0/8.0)%(int)L << "\n";
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:8: error: 'cin' is not a member of 'std'
    2 |   std::cin.tie(0); std::ios::sync_with_stdio(false);
      |        ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main() {
a.cc:2:25: error: 'std::ios' has not been declared
    2 |   std::cin.tie(0); std::ios::sync_with_stdio(false);
      |                         ^~~
a.cc:3:28: error: 'cin' is not a member of 'std'
    3 |   int N; double L, T; std::cin >> N >> L >> T;
      |                            ^~~
a.cc:3:28: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:4:8: error: 'vector' is not a member of 'std'
    4 |   std::vector<double> x(N), v(N), a(N);
      |        ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | int main() {
a.cc:4:15: error: expected primary-expression before 'double'
    4 |   std::vector<double> x(N), v(N), a(N);
      |               ^~~~~~
a.cc:7:20: error: 'cin' is not a member of 'std'
    7 |     int X, W; std::cin >> X >> W;
      |                    ^~~
a.cc:7:20: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:5: error: 'x' was not declared in this scope
    8 |     x[i] = X;
      |     ^
a.cc:10:7: error: 'v' was not declared in this scope
   10 |       v[i] = 1.0;
      |       ^
a.cc:11:7: error: 'a' was not declared in this scope
   11 |       a[i] = std::fmod(x[i] + T, L);
      |       ^
a.cc:11:19: error: 'fmod' is not a member of 'std'
   11 |       a[i] = std::fmod(x[i] + T, L);
      |                   ^~~~
a.cc:13:7: error: 'v' was not declared in this scope
   13 |       v[i] = -1.0;
      |       ^
a.cc:14:7: error: 'a' was not declared in this scope
   14 |       a[i] = std::fmod(x[i] - T, L);
      |       ^
a.cc:14:19: error: 'fmod' is not a member of 'std'
   14 |       a[i] = std::fmod(x[i] - T, L);
      |                   ^~~~
a.cc:15:19: error: 'fmod' is not a member of 'std'
   15 |       a[i] = std::fmod(a[i]+L, L);
      |                   ^~~~
a.cc:18:15: error: 'a' was not declared in this scope
   18 |   double p0 = a[0];
      |               ^
a.cc:19:8: error: 'sort' is not a member of 'std'
   19 |   std::sort(a.begin(), a.end());
      |        ^~~~
a.cc:21:6: error: 'v' was not declared in this scope
   21 |   if(v[0] > 0) {
      |      ^
a.cc:23:16: error: 'x' was not declared in this scope
   23 |       if(T+T > x[i]-x[0]) {
      |                ^
a.cc:29:19: error: 'x' was not declared in this scope
   29 |     if(T+T > L - (x[i]-x[0])) {
      |                   ^
a.cc:35:17: error: 'lower_bound' is not a member of 'std'
   35 |   int i0 = std::lower_bound(a.begin(), a.end(), p0) - a.begin();
      |                 ^~~~~~~~~~~
a.cc:38:10: error: 'cout' is not a member of 'std'
   38 |     std::cout << int(a[(i0+i)%N]+1.0/8.0)%(int)L << "\n";
      |          ^~~~
a.cc:38:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'