Submission #1251904

#TimeUsernameProblemLanguageResultExecution timeMemory
1251904kolpo0210Finding Routers (IOI20_routers)C++20
0 / 100
1 ms328 KiB
#include "routers.h" #include <vector> using namespace std; std::vector<int> find_routers(int l, int n, int q) { vector<int> pos(n); pos[0] = 0; for (int i = 1; i < n; ++i) { int lo = pos[i - 1] + 2; int hi = l; int res = l; while (lo <= hi) { int mid = ((lo + hi) / 2) / 2 * 2; int label = use_detector(mid); if (label >= i) { res = mid; hi = mid - 2; } else { lo = mid + 2; } } pos[i] = 2 * res - pos[i - 1]; } return pos; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...