Submission #991687

#TimeUsernameProblemLanguageResultExecution timeMemory
991687AbitoSpeedrun (RMI21_speedrun)C++17
0 / 100
23 ms768 KiB
#include "speedrun.h" #include <bits/stdc++.h> using namespace std; void assignHints(int subtask, int n, int A[], int B[]) { setHintLen(20); int deg[n+2]; for (int i=1;i<=n;i++) deg[i]=0; for (int i=1;i<n;i++) deg[A[i]]++,deg[B[i]]++; int root=1; for (int i=1;i<=n;i++) if (deg[i]>deg[root]) root=i; for (int j=0;j<20;j++){ if (!(root&(1<<j))) continue; for (int i=1;i<=n;i++) setHint(i,j+1,1); } return; } void speedrun(int subtask, int n, int start) { int root=0; for (int i=1;i<=n;i++) if (getHint(i)) root+=(1<<(i-1)); if (root!=start) goTo(root); for (int i=1;i<=n;i++){ if (i==root) continue; goTo(i); goTo(root); }return; return; }
#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...