Submission #991690

#TimeUsernameProblemLanguageResultExecution timeMemory
991690AbitoSpeedrun (RMI21_speedrun)C++17
19 / 100
63 ms784 KiB
#include "speedrun.h" #include <bits/stdc++.h> using namespace std; #define pb push_back void dfs(int x,int p){ //cout<<x<<' '<<p<<endl; int to=0; for (int i=1;i<=10;i++) if (getHint(i)) to+=(1<<(i-1)); if (to && to!=p) goTo(to),dfs(to,x); to=0; for (int i=11;i<=20;i++) if (getHint(i)) to+=(1<<(i-11)); if (to && to!=p) goTo(to),dfs(to,x); if (p) goTo(p); return; } void assignHints(int subtask, int n, int A[], int B[]) { setHintLen(20); vector<int> adj[n+2]; for (int i=1;i<n;i++) adj[A[i]].pb(B[i]),adj[B[i]].pb(A[i]); for (int i=1;i<=n;i++){ int x=adj[i][0],y=0; if (adj[i].size()==2) y=adj[i][1]; for (int j=0;j<10;j++) if (x&(1<<j)) setHint(i,j+1,1); for (int j=0;j<10;j++) if (y&(1<<j)) setHint(i,j+11,1); }return; } void speedrun(int subtask, int n, int start) { dfs(start,0); 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...