Submission #1165935

#TimeUsernameProblemLanguageResultExecution timeMemory
1165935aminabouakazPyramids (IOI24_pyramids)C++20
Compilation error
0 ms0 KiB
bool can_transform(int L, int R, int X, int Y) { int sum_A = sumA[R] - (L > 0 ? sumA[L - 1] : 0); int sum_B = sumB[Y] - (X > 0 ? sumB[X - 1] : 0); if (sum_A != sum_B) { return false; } for (int i = L, j = X; i <= R; ++i, ++j) { int current_sum_A = sumA[i] - (L > 0 ? sumA[L - 1] : 0); int current_sum_B = sumB[j] - (X > 0 ? sumB[X - 1] : 0); if (current_sum_A != current_sum_B) { return false; } } return true; }

Compilation message (stderr)

pyramids.cpp: In function 'bool can_transform(int, int, int, int)':
pyramids.cpp:3:17: error: 'sumA' was not declared in this scope; did you mean 'sum_A'?
    3 |     int sum_A = sumA[R] - (L > 0 ? sumA[L - 1] : 0);
      |                 ^~~~
      |                 sum_A
pyramids.cpp:4:17: error: 'sumB' was not declared in this scope; did you mean 'sum_B'?
    4 |     int sum_B = sumB[Y] - (X > 0 ? sumB[X - 1] : 0);
      |                 ^~~~
      |                 sum_B