Submission #933581

#TimeUsernameProblemLanguageResultExecution timeMemory
933581vjudge1Speedrun (RMI21_speedrun)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define endl '\n' #define mp make_pair #define f first #define s second #define pb push_back #define all(x) x.begin(),x.end() #define fore(i,l,r) for(int i = l; i < r;i++) #define forex(i,r,l) for(int i = r; i>= l;i--) #define fo(i,n) fore(i,0,n) #define ffo(i,n) forex(i,n-1,0) #define lsb(x) x&(-x) using namespace std; using ii = pair<int,int>;using ll = long long; using ull = unsigned long long; using vi = vector<int>; // const int maxN = 30; // int hintlen,mistart;vi res; // int num[maxN]; // void setHintlen(int sz){ // hintlen=sz; // } // void setHint(int a, int b, bool cl){ // if(num[a]&1<<b == cl)return; // num[a]^=1<<b; // } // int getLength(){return hintlen;} // bool getHint(int j ){ // cout << mistart << " " << j << endl; cout.flush(); // return (num[mistart]&(1<<j) ? 1 : 0 ); // } // bool goTo(int j){ // if(num[mistart]&(1<<j) == 0)return false; // res.pb(j); // mistart=j; // return true; // } void assignHints(int subtask, int N , int A[], int B[]){ setHintlen(N); fore(i,1,N){ setHint(A[i], B[i], 1); setHint(B[i], A[i], 1); } } vector<vector<int>> graph; vector<bool> precalc, vis;int szn; void dfs(int nodo, int donde = 0){ if(!precalc[nodo]){ precalc[nodo] = 1; fore(i,1,szn+1){ if(getHint(i)){ graph[nodo].pb(i); } } } for(int v : graph[nodo]){ if(!vis[v]){ vis[v]=1; goTo(v);dfs(v, nodo); } } if(donde == 0)return ; goTo(donde); } void speedrun(int subtask, int N, int start){ vis.resize(N+2,0);precalc.resize(N+2,0);szn=N; graph.resize(N+2);getLength(); vis[start] = 1; dfs(start); }

Compilation message (stderr)

speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:38:5: error: 'setHintlen' was not declared in this scope; did you mean 'strnlen'?
   38 |     setHintlen(N);
      |     ^~~~~~~~~~
      |     strnlen
speedrun.cpp:40:9: error: 'setHint' was not declared in this scope; did you mean 'setns'?
   40 |         setHint(A[i], B[i], 1);
      |         ^~~~~~~
      |         setns
speedrun.cpp: In function 'void dfs(int, int)':
speedrun.cpp:50:16: error: 'getHint' was not declared in this scope; did you mean 'getline'?
   50 |             if(getHint(i)){
      |                ^~~~~~~
      |                getline
speedrun.cpp:58:13: error: 'goTo' was not declared in this scope
   58 |             goTo(v);dfs(v, nodo);
      |             ^~~~
speedrun.cpp:62:5: error: 'goTo' was not declared in this scope
   62 |     goTo(donde);
      |     ^~~~
speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:66:23: error: 'getLength' was not declared in this scope
   66 |     graph.resize(N+2);getLength();
      |                       ^~~~~~~~~