Submission #869248

#TimeUsernameProblemLanguageResultExecution timeMemory
869248MinaRagy06Speedrun (RMI21_speedrun)C++17
Compilation error
0 ms0 KiB
#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 (stderr)

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);
      |           ^~~~