제출 #1221064

#제출 시각아이디문제언어결과실행 시간메모리
1221064SpyrosAlivHack (APIO25_hack)C++20
25 / 100
967 ms16452 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) * (MX % i);
        if (willDo == tot) return i;
    }
    assert(false);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...