This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "routers.h"
using namespace std;
vector<int> sz;
int el=0, id=0, c=64, kis, nagy, po;
vector<int> find_routers(int h, int n, int q) {
sz.push_back(0);
for (int i=1; i<n; i++) {
if (n==2) kis=el+1, nagy=h;
else {
kis=el+1, nagy=min(h, el+c), po=c;
while(use_detector(nagy)==id) {
kis=nagy, nagy=min(h, nagy+po), po*=2;
}
}
while(nagy-kis>1) {
int koz=(nagy+kis)/2;
if (use_detector(koz)==id) kis=koz;
else nagy=koz;
}
sz.push_back(2*kis-el), el=sz.back(), id++;
}
return sz;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |