Submission #1207576

#TimeUsernameProblemLanguageResultExecution timeMemory
1207576cheat_when_I_was_youngHack (APIO25_hack)C++17
Compilation error
0 ms0 KiB
int hack() { vector<long long> a; for (int i = 1; i <= 1000000; ++i) a.emplace_back(i); long long res = collisions(a); for (int n = 1; n <= 1000000; ++n) { int q = 1000000 / n; int r = 1000000 % n; long long val = (long long)q * (q - 1) / 2 * n + (long long)q * r; if (val == res) return n; } return -1; }

Compilation message (stderr)

hack.cpp: In function 'int hack()':
hack.cpp:2:5: error: 'vector' was not declared in this scope
    2 |     vector<long long> a;
      |     ^~~~~~
hack.cpp:2:12: error: expected primary-expression before 'long'
    2 |     vector<long long> a;
      |            ^~~~
hack.cpp:3:40: error: 'a' was not declared in this scope
    3 |     for (int i = 1; i <= 1000000; ++i) a.emplace_back(i);
      |                                        ^
hack.cpp:4:32: error: 'a' was not declared in this scope
    4 |     long long res = collisions(a);
      |                                ^
hack.cpp:4:21: error: 'collisions' was not declared in this scope
    4 |     long long res = collisions(a);
      |                     ^~~~~~~~~~