제출 #1258662

#제출 시각아이디문제언어결과실행 시간메모리
1258662tamzidFinding Routers (IOI20_routers)C++20
70.13 / 100
1 ms328 KiB
#include <bits/stdc++.h> #include "routers.h" using namespace std; using ll = long long; std::vector<int> find_routers(int l, int n, int q) { vector<int> answer; answer.push_back(0); int last = 0; for(int i=1;i<n;++i) { int low = answer.back() + 1, high = l, ans = -1; while(low <= high) { int mid = (low + high) / 2; if(use_detector(mid) == last) { low = mid + 1; } else { ans = mid; high = mid - 1; } } ++last; int dis = ans - answer.back(); --dis; answer.push_back(answer.back() + (dis * 2)); } return answer; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...