Submission #1203495

#TimeUsernameProblemLanguageResultExecution timeMemory
1203495mayacFinding Routers (IOI20_routers)C++20
0 / 100
1 ms320 KiB
#include "routers.h"
#include <iostream>
#include <vector>
using namespace std;

std::vector<int> find_routers(int l, int n, int q) {
    int a,cur;
    vector<int> ans(n,0);
	for (int i = 1; i < n; i++) {
		cur = ans[i - 1];
		for (int step = (l - cur + 2) / 2; step > 0; step /= 2) {
			cur += step;
			a = use_detector(cur);
			if (a >= i)a -= step;
			if (step > 1)step++;
		}
		ans[i] = cur * 2 - ans[i - 1];
	}
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...