답안 #764871

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
764871 2023-06-24T06:09:25 Z vjudge1 Speedrun (RMI21_speedrun) C++17
컴파일 오류
0 ms 0 KB
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <cmath>
#include <queue>
#include <map>
#include <set>
// #include "speedrun.h"

// Akhmet Issa

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define ent "\n"

const int maxn = 1e6 + 100;
const ll INF = (ll)2e18;
const int inf = (ll)2e9;
const int maxl = 20;
const int MOD = 1e9 + 7;

vector<int> g[maxn];
int used[maxn];

void assignHints(int subtask, int n, int A [], int B []){
    for(int i = 1; i < n; i++){
        g[A[i]].push_back(B[i]);
        g[B[i]].push_back(A[i]);
    }
    setHintLen(n);
    for(int i = 1; i <= n; i++){
        for(int to: g[i]){
            setHint(i, to, 1);
        }
    }
}

void dfs(int v, int n){
    used[v] = 1;
    for(int to = 1; to <= n; to++){
        if(getHint(to) && !used[to]){
            goTo(to);
            dfs(to, n);
        }
    }
}

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

Compilation message

speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:33:5: error: 'setHintLen' was not declared in this scope
   33 |     setHintLen(n);
      |     ^~~~~~~~~~
speedrun.cpp:36:13: error: 'setHint' was not declared in this scope
   36 |             setHint(i, to, 1);
      |             ^~~~~~~
speedrun.cpp: In function 'void dfs(int, int)':
speedrun.cpp:44:12: error: 'getHint' was not declared in this scope; did you mean 'getline'?
   44 |         if(getHint(to) && !used[to]){
      |            ^~~~~~~
      |            getline
speedrun.cpp:45:13: error: 'goTo' was not declared in this scope
   45 |             goTo(to);
      |             ^~~~