Submission #1221061

#TimeUsernameProblemLanguageResultExecution timeMemory
1221061SpyrosAlivHack (APIO25_hack)C++20
Compilation error
0 ms0 KiB
#include "hack.h" #include <bits/stdc++.h> using namespace std; #define ll long long const int MX = 1e6; int hack() { vector<ll> willAsk; for (int i = 1; i <= MX; i++) willAsk.push_back(i); ll tot = collisions(willAsk); for (int i = 1; i <= MX; i++) { ll range = MX / i - 1; ll willDo = i * range * (range + 1) / 2 + (range + 1) * (x % n); if (willDo == tot) return i; } assert(false); }

Compilation message (stderr)

hack.cpp: In function 'int hack()':
hack.cpp:14:66: error: 'x' was not declared in this scope
   14 |         ll willDo = i * range * (range + 1) / 2 + (range + 1) * (x % n);
      |                                                                  ^
hack.cpp:14:70: error: 'n' was not declared in this scope
   14 |         ll willDo = i * range * (range + 1) / 2 + (range + 1) * (x % n);
      |                                                                      ^