제출 #1203483

#제출 시각아이디문제언어결과실행 시간메모리
1203483mayacFinding Routers (IOI20_routers)C++20
컴파일 에러
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;
}

컴파일 시 표준 에러 (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);
      |                             ^~~~~~~~~~~~