제출 #1360143

#제출 시각아이디문제언어결과실행 시간메모리
1360143AvianshHack (APIO25_hack)C++20
78.10 / 100
140 ms1280 KiB
#include "hack.h"
#include <bits/stdc++.h>

using namespace std;

mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
const long long inf = 1e14;
uniform_int_distribution<long long>ran(1,inf);

const int constant = 22370;

void roll(vector<long long> &arr){
    assert(arr.size()==0);
    for(int i = 1;i<constant;i++){
        arr.push_back(i);
    }
    for(int i = 0;i<constant;i++){
        arr.push_back(5e8+1LL*i*constant);
    }
}

int hack(){
    int lo = 1;
    int hi = 1e9;
    while(lo<hi){
        int mid = (lo+hi)/2;
        vector<long long>quer;
        int sq = sqrt(mid-lo+1);
        for(int i = 1;i<=sq;i++){
            quer.push_back(i);
        }
        int cur = mid+1;
        while(cur>sq){
            quer.push_back(cur);
            if(cur-sq<lo)
                break;
            cur-=sq;
        }
        if(collisions(quer)){
            hi=mid;
        }
        else{
            lo=mid+1;
        }
    }
    return lo;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…