Submission #504845

#TimeUsernameProblemLanguageResultExecution timeMemory
504845socpiteSpeedrun (RMI21_speedrun)C++14
100 / 100
244 ms936 KiB
#include<bits/stdc++.h> #include<speedrun.h> using namespace std; vector<vector<int>> graph; vector<int> order; void sh(int pos, int id, int val){ for(int i = 0; i < 10; i++){ setHint(pos, i + id*10+1, val&(1<<i)); } } void DFS(int x, int p){ sh(x, 0, p); order.push_back(x); for(auto v: graph[x])if(v!=p)DFS(v, x); } int gtval(int id){ int re = 0; for(int i = 0; i < 10; i++){ re|=(getHint(i+id*10+1)<<i); } return re; } void assignHints (int subtask , int n, int A[], int B[]){ setHintLen(20); graph.resize(n+1); for(int i = 1; i < n; i++){ graph[A[i]].push_back(B[i]); graph[B[i]].push_back(A[i]); } DFS(1, 0); for(int i = 0; i < n-1; i++){ sh(order[i], 1, order[i+1]); } sh(order[n-1], 1, 0); } void speedrun(int subtask , int N, int start ){ int suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu = getLength(); while(gtval(0)){ goTo(gtval(0)); } int curr = gtval(1); while(curr){ while(!goTo(curr))goTo(gtval(0)); curr = gtval(1); } }

Compilation message (stderr)

speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:43:9: warning: unused variable 'suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu' [-Wunused-variable]
   43 |     int suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu = getLength();
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...