Submission #923943

#TimeUsernameProblemLanguageResultExecution timeMemory
923943Tyx2019Speedrun (RMI21_speedrun)C++17
Compilation error
0 ms0 KiB
#include "speedrun.h" #include <bits/stdc++.h> using namespace std; vector<int> adj[1005]; vector<int> dfsorder; int pararray[1005]; void dfs(int cur, int par){ pararray[cur]=par; dfsorder.push_back(cur); for(auto newnode:adj[cur]){ if(newnode!=par){ dfs(newnode,cur); } } } void assignHints(int subtask, int N, int A[], int B[]) { //cout << " am i gay " << endl; for(int i=1;i<N;i++){ adj[A[i]].push_back(B[i]); adj[B[i]].push_back(A[i]); } //cout << "yes i am " << endl; dfs(1, 1023); //cout << "i eat kids" << endl; setHintLen(20); int nextinline[N+5]; for(int i=1;i<N;i++){ nextinline[dfsorder[i-1]]=dfsorder[i]; } //cout << dfsorder.size() << endl; //cout << "Sorry i eat kids" << endl; nextinline[dfsorder[N-1]]=1023; //cout << "sorry what" << endl; for(int i=1;i<=N;i++){ int paren=pararray[i]; for(int j=1;j<=10;j++){ if((paren&(1<<j))==0) setHint(i,j,false); else setHint(i,j,true); } int nex=nextinline[i]; for(int j=1;j<=10;j++){ if((nex&(1<<j))==0) setHint(i,j+10,false); else setHint(i,j+10,true); } } } void speedrun(int subtask, int N, int start) { //Get to the root int cur=start; while(cur!=1){ int paren=0; int lol=1; for(int i=1;i<=10;i++){ paren += getHint(i) * lol; lol *= 2; } goTo(paren); cur=paren; } return; int parens[N+5]; for(int j=0;j<N-1;j++){ par=0; lul=1; for(int i=1;i<=10;i++){ par += getHint(i)*lul; lul*=2; } parens[cur]=par; int next=0; int lol=1; for(int i=11;i<=20;i++){ next += getHint(i) * lol; lol *= 2; } if(goTo(next)){ cur=next; } else{ while(true){ int backto=parens[cur]; goTo(backto); if(goTo(next)){ cur=next; break; } } } } return; //Do the tour }

Compilation message (stderr)

speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:64:8: error: 'par' was not declared in this scope; did you mean '__pstl::execution::v1::par'?
   64 |        par=0;
      |        ^~~
      |        __pstl::execution::v1::par
In file included from /usr/include/c++/10/pstl/glue_algorithm_defs.h:15,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from speedrun.cpp:2:
/usr/include/c++/10/pstl/execution_defs.h:111:27: note: '__pstl::execution::v1::par' declared here
  111 | constexpr parallel_policy par{};
      |                           ^~~
speedrun.cpp:65:8: error: 'lul' was not declared in this scope
   65 |        lul=1;
      |        ^~~