Submission #857622

#TimeUsernameProblemLanguageResultExecution timeMemory
857622lbadea1000Speedrun (RMI21_speedrun)C++17
Compilation error
0 ms0 KiB
#include <iostream> #include <vector> using namespace std; //#include "speedrun.h" const int NMAX = 1000; vector<int> edges[NMAX + 1]; int parent[NMAX + 1]; int nextInOrder[NMAX + 2]; int orderTime; void dfs(int node, int par) { parent[node] = par; nextInOrder[orderTime++] = node; for(auto child : edges[node]) { if(child != par) dfs(child, node); } } void assignHints (int subtask , int N, int A[], int B[]) { for(int i = 1; i <= N - 1; i++) { edges[A[i]].push_back(B[i]); edges[B[i]].push_back(A[i]); } int l = 10; setHintLen(2 * l); orderTime = 1; dfs(1, 0); nextInOrder[N + 1] = 1; for(int i = 1; i <= N; i++) { for(int bit = 0; bit < l; bit++) { setHint(nextInOrder[i], bit + 1, parent[nextInOrder[i]] & (1 << bit)); setHint(nextInOrder[i], bit + l + 1, nextInOrder[i + 1] & (1 << bit)); } } } void speedrun(int subtask , int N, int start ) { /*int node = start; int l = getLength (); for(int i = 1; i <= N - 1; i++) { int par, nextNode; par = nextNode = 0; for(int bit = 0; bit < l; bit++) { par += (1 << bit) * getHint(bit + 1); nextNode += (1 << bit) * getHint(bit + 1 + l); } while(goTo(nextNode) == false) { node = par; goTo(node); par = 0; for(int bit = 0; bit < l; bit++) par += (1 << bit) * getHint(bit + 1); } node = nextNode; }*/ }

Compilation message (stderr)

speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:30:5: error: 'setHintLen' was not declared in this scope
   30 |     setHintLen(2 * l);
      |     ^~~~~~~~~~
speedrun.cpp:36:13: error: 'setHint' was not declared in this scope
   36 |             setHint(nextInOrder[i], bit + 1, parent[nextInOrder[i]] & (1 << bit));
      |             ^~~~~~~