# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1221061 | SpyrosAliv | Hack (APIO25_hack) | C++20 | 0 ms | 0 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);
}