제출 #1258661

#제출 시각아이디문제언어결과실행 시간메모리
1258661tamzidFinding Routers (IOI20_routers)C++20
0 / 100
1 ms320 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; answer.push_back(answer.back() + ((ans - answer.back() - 1) * 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...