제출 #1207576

#제출 시각아이디문제언어결과실행 시간메모리
1207576cheat_when_I_was_youngHack (APIO25_hack)C++17
컴파일 에러
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; }

컴파일 시 표준 에러 (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);
      |                     ^~~~~~~~~~