답안 #869248

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
869248 2023-11-03T19:22:28 Z MinaRagy06 Speedrun (RMI21_speedrun) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#ifdef MINA
#include "grader.cpp"
#endif
using namespace std;
typedef int64_t ll;

void assignHints(int subtask, int n, int a[], int b[]) {
	if (subtask == 1) {
		vector<int> adj[n + 1];
		for (int i = 1; i < n; i++) {
			adj[a[i]].push_back(b[i]);
			adj[b[i]].push_back(a[i]);
		}
		setHintLen(n);
		for (int i = 1; i <= n; i++) {
			for (auto nxt : adj[i]) {
				setHint(i, nxt, 1);
			}
		}
	}
}
void dfs(int i, int par, int n) {
	for (int nxt = 1; nxt <= n; nxt++) {
		if (nxt == par) continue;
		if (getHint(nxt)) {
			goTo(nxt);
			dfs(nxt, i, n);
		}
	}
	if (par) goTo(par);
}
void speedrun(int subtask, int n, int start) {
	if (subtask == 1) {
		dfs(start, 0, n);
	}
}

Compilation message

speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:15:3: error: 'setHintLen' was not declared in this scope
   15 |   setHintLen(n);
      |   ^~~~~~~~~~
speedrun.cpp:18:5: error: 'setHint' was not declared in this scope; did you mean 'setns'?
   18 |     setHint(i, nxt, 1);
      |     ^~~~~~~
      |     setns
speedrun.cpp: In function 'void dfs(int, int, int)':
speedrun.cpp:26:7: error: 'getHint' was not declared in this scope; did you mean 'getline'?
   26 |   if (getHint(nxt)) {
      |       ^~~~~~~
      |       getline
speedrun.cpp:27:4: error: 'goTo' was not declared in this scope
   27 |    goTo(nxt);
      |    ^~~~
speedrun.cpp:31:11: error: 'goTo' was not declared in this scope
   31 |  if (par) goTo(par);
      |           ^~~~