Submission #434377

#TimeUsernameProblemLanguageResultExecution timeMemory
434377jeqchoFinding Routers (IOI20_routers)C++17
70.13 / 100
2 ms332 KiB
#include "routers.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<pii> vpi; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define F0R(i,b) FOR(i,0,b) #define ROF(i,a,b) for(int i=(b)-1;i>=(a);--i) #define R0F(i,b) ROF(i,0,b) #define all(x) begin(x),end(x) #define sz(x) int(x.size()) #define pb push_back #define rsz resize #define trav(a,x) for(auto&a :x) #define fi first #define se second vi find_routers(int l, int n, int q) { vi v; v.pb(0); FOR(i,1,n) { int lef=v.back(); int rig=l; int ans=-1; while(lef<=rig) { int mid=(lef+rig)/2; int res=use_detector(mid); if(res<i) { lef=mid+1; ans=mid; } else{ rig=mid-1; } } v.pb(ans*2-v.back()); } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...