Submission #1230133

#TimeUsernameProblemLanguageResultExecution timeMemory
1230133sethodFinding Routers (IOI20_routers)C++20
0 / 100
2095 ms576 KiB
#include "routers.h" #include <bits/stdc++.h> using namespace std; vector<int> find_routers(int l, int n, int q) { vector<int> ans; ans.push_back(0); int road[l]; memset(road, -1, sizeof(road)); for(int i = 1; i < n; i++){ int l = ans.back(); int r = l - 1; int pos = -1; while(l > r){ int m = (l + r) / 2; if(road[m] == -1) road[m] = use_detector(m); if(road[m] >= i){ r = m - 1; pos = m; } else l = m + 1; } int tmp = pos - ans[i - 1]; ans[i] = pos + (tmp - 1) - 1; } 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...