제출 #1215149

#제출 시각아이디문제언어결과실행 시간메모리
1215149BzslayedHack (APIO25_hack)C++20
25 / 100
930 ms24280 KiB
#include "hack.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long

const int mx = 1000000;
ll calc(ll x){
    ll buc = mx/x;
    ll ans = (buc*(buc-1)/2)*x;
    ans += buc*(mx%x);

    return ans;
}

int hack(){
    vector<ll> v;
    for (int i=1; i<=1000000; i++) v.push_back(i);
    ll res = collisions(v);

    static ll prec[1000005];
    for (int i=1; i<=1000000; i++) prec[i] = calc(i);

    for (int i=1; i<=1000000; i++){
        if (res == prec[i]) return i;
    }

    return -1;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...