답안 #933593

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
933593 2024-02-26T00:52:33 Z vjudge1 Speedrun (RMI21_speedrun) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

bool vis[10000];

void dfs(int x, int p) {

    vis[x] = true;

    for(int i=1; i<=N; i++) {
       
        if(getHint(i) && !vis[i]) {
            goTo(i);
            dfs(i, x);
        }
    }

    goTo(p);

}

void assignHints(int subtask, int N, int A[], int B[]) {

    setHintLen(N);

    for(int i=1; i<N; i++) {
        setHint(A[i], B[i], true);
        setHint(B[i], A[i], true);
    }

}

void speedrun(int subtask, int N, int start) {
    dfs(start, start);
}

Compilation message

speedrun.cpp: In function 'void dfs(int, int)':
speedrun.cpp:10:21: error: 'N' was not declared in this scope
   10 |     for(int i=1; i<=N; i++) {
      |                     ^
speedrun.cpp:12:12: error: 'getHint' was not declared in this scope; did you mean 'getline'?
   12 |         if(getHint(i) && !vis[i]) {
      |            ^~~~~~~
      |            getline
speedrun.cpp:13:13: error: 'goTo' was not declared in this scope
   13 |             goTo(i);
      |             ^~~~
speedrun.cpp:18:5: error: 'goTo' was not declared in this scope
   18 |     goTo(p);
      |     ^~~~
speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:24:5: error: 'setHintLen' was not declared in this scope
   24 |     setHintLen(N);
      |     ^~~~~~~~~~
speedrun.cpp:27:9: error: 'setHint' was not declared in this scope; did you mean 'setns'?
   27 |         setHint(A[i], B[i], true);
      |         ^~~~~~~
      |         setns