Submission #559414

#TimeUsernameProblemLanguageResultExecution timeMemory
559414AlperenTFinding Routers (IOI20_routers)C++17
98.27 / 100
1 ms252 KiB
#include "routers.h" #include <bits/stdc++.h> using namespace std; vector<int> find_routers(int len, int n, int q) { vector<int> ans; ans.push_back(0); int lft = 0; for(int cur = 1; cur < n; cur++){ again: int curlen = ceil(((len - lft) / (n - cur)) * 0.90); int l = lft, r = min(lft + curlen, len) + 1; while(r - l > 1){ int m = l + (r - l) / 2; if(use_detector(m) >= cur) r = m; else l = m; } if(r == min(lft + curlen, len) + 1){ lft = r - 1; goto again; } l = r - 1; lft = l + (l - ans.back()); ans.push_back(lft); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...