제출 #574960

#제출 시각아이디문제언어결과실행 시간메모리
574960KrisjanisPFinding Routers (IOI20_routers)C++14
100 / 100
1 ms336 KiB
#include "routers.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; std::vector<int> find_routers(int l, int n, int q) { vector<int> res(n,l-(l%2)); res[0]=0; for(ll i=1;i<n;i++) { ll a = (res[i-1]+1), b = res[i]; res[i] = b; while(a<=b) { ll m = (a+b)/2; ll x = use_detector(m); for(ll j=i;j<=x;j++) res[j]=min((ll)res[j],m); if(x<i) a=m+1; else b=m-1; } //cout<<"res[i]: "<<res[i]<<"\n"; res[i] = 2*res[i]-res[i-1]-2; } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...