Submission #1203483

#TimeUsernameProblemLanguageResultExecution timeMemory
1203483mayacFinding Routers (IOI20_routers)C++20
Compilation error
0 ms0 KiB

#include <iostream>
#include <vector>
using namespace std;

std::vector<int> find_routers(int l, int n, int q) {
    int idx = l,a,cur;
    vector<int> ans(n,0);
    for (int i = n-1; i >0; i--) {
		cur = 0;
		for (int step = idx/2; step > 0; step /= 2) {
			cur += step;
			a = use_detector(cur);
			if (a >= i)cur -= step;
			if (step > 1)step++;
		}
		idx = cur;
		ans[i] = cur;
	}
	for (int i = 1; i < n; i++) {
		ans[i] = ans[i] * 2 - ans[i - 1];
	}
	return ans;
}

Compilation message (stderr)

routers.cpp: In function 'std::vector<int> find_routers(int, int, int)':
routers.cpp:13:29: error: 'use_detector' was not declared in this scope
   13 |                         a = use_detector(cur);
      |                             ^~~~~~~~~~~~