Submission #639812

#TimeUsernameProblemLanguageResultExecution timeMemory
639812DragonO_oSpeedrun (RMI21_speedrun)C++17
0 / 100
211 ms740 KiB
#include "speedrun.h" #include <bits/stdc++.h> using namespace std; const int maxn=1e3+5; vector<int>adj[maxn]; vector<int>ord; int p[maxn]; void dfs(int v,int pr){ p[v]=pr; ord.push_back(v); for(int to:adj[v]){ if(to!=pr){ dfs(to,v); } } } void assignHints(int subtask,int N,int A[],int B[]){ setHintLen(20); for(int i=1;i<N;++i){ adj[A[i]].push_back(B[i]); adj[B[i]].push_back(A[i]); } dfs(1,-1); for(int i=1;i<=N;++i){ int cur=ord[i-1]; int nxt=ord[i%N]; for(int bit=0;bit<10;++bit){ setHint(cur,bit+1,nxt&(1<<bit)); setHint(cur,bit+11,p[cur]&(1<<bit)); } } } void speedrun(int subtask,int N,int start){ int vis=0; while(vis<N){ int nxt=0; for(int bit=0;bit<10;++bit){ nxt|=(getHint(bit+1)>>bit); } while(!goTo(nxt)){ int pr=0; for(int bit=0;bit<10;++bit){ pr|=(getHint(bit+11)>>bit); } goTo(pr); } } }
#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...