# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1207577 | cheat_when_I_was_young | Hack (APIO25_hack) | C++17 | 0 ms | 0 KiB |
#include "bits/stdc++.h"
using namespace std;
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;
}