제출 #1211038

#제출 시각아이디문제언어결과실행 시간메모리
1211038hengliaoHack (APIO25_hack)C++20
큐에 대기중
0 ms0 KiB
#include "hack.h" #include<bits/stdc++.h> using namespace std; #define F first #define S second #define pll pair<ll, ll> #define vll vector<ll> #define pb push_back typedef long long ll; namespace{ const ll mxN=1e9; vll f(ll a, ll b){ ll len=b-a+1; ll B=sqrt(len); vll re; for(ll i=1;i<=B;i++){ re.pb(i); } ll cur=B+a; while(true){ re.pb(cur); if(cur-1==b) break; cur=min(cur+B, b+1); } return re; } } int hack(){ ll lef=2, rig=mxN; while(lef<rig){ ll mid=(lef+rig)/2; if(collisions(f(lef, mid))>0){ rig=mid; } else{ lef=mid+1; } } return (int) lef; }