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 "routers.h"
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k, l) for(int i = (j); i < (k); i += (l))
#define FORD(i, j, k, l) for(int i = (j); i >= (k); i -= (l))
#define REP(i, n) FOR(i, 0, n, 1)
#define REPD(i, n) FORD(i, n, 0, 1)
#define pb push_back
typedef long long ll;
std::vector<int> find_routers(int l, int n, int q) {
vector<int> ans;
ans.pb(0);
const int mx = 19;
REP(i, n - 1){
int curr = ans.back();
FORD(j, mx, 0, 1){
int tm = use_detector(min(l, (curr + (1 << j))));
if(tm == i)
curr += (1 << j);
}
ans.pb(curr + (curr - ans.back()));
}
return ans;
}
# | 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... |