Submission #1224147

#TimeUsernameProblemLanguageResultExecution timeMemory
1224147jasonicHack (APIO25_hack)C++20
78.10 / 100
167 ms1284 KiB
#include "hack.h"
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define fastIO cin.tie(0); ios::sync_with_stdio(false)

int hack() {
    ll l = -1, r = 1e9 + 1;

    while(l + 1 < r) {
        ll m = (l+r)/2;
        // check if its in [l, m]
        ll s = sqrt(m-l+1);
        vector<ll> send;
        for(ll i = 1; i <= s; i++) send.push_back(i);
        ll right = m+1;
        while(right > s) {
            send.push_back(right);
            if(right - s <= l) break;
            right -= s;
        }

        if(collisions(send) > 0) r = m;
        else l = m;
    }

    return r; 
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...