Submission #1230415

#TimeUsernameProblemLanguageResultExecution timeMemory
1230415lechaaFinding Routers (IOI20_routers)C++20
100 / 100
1 ms584 KiB
#include "routers.h" #include <bits/stdc++.h> using namespace std; std::vector<int> find_routers(int l, int n, int q){ vector<int> a(l+1, -1); vector<int> pos = {0}; for(int i = 1; i < n; i++){ int low = 0; int top = l; int ns = 0; while(low <= top){ int mid = (low+top)/2; if(a[mid] == -1){ a[mid] = use_detector(mid); } if(a[mid] < i){ ns = mid; low = mid+1; }else{ top = mid-1; } } pos.push_back(pos[i-1] + (ns - pos[i-1]) * 2); } 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...