Submission #503662

#TimeUsernameProblemLanguageResultExecution timeMemory
503662blueSpeedrun (RMI21_speedrun)C++17
8 / 100
107 ms660 KiB
#include "speedrun.h" #include <vector> #include <algorithm> using namespace std; using vi = vector<int>; void assignHints(int subtask, int N, int A[], int B[]) { vi deg(1+N, 0); for(int e = 1; e < N; e++) { deg[A[e]]++; deg[B[e]]++; } int x = 0; for(int i = 1; i <= N; i++) if(deg[i] == N-1) x = i; setHintLen(10); for(int u = 1; u <= N; u++) for(int b = 0; b < 10; b++) setHint(u, b+1, bool(x & (1 << b))); // setHint(x, 1, 1); } void speedrun(int subtask, int N, int start) { int x = 0; for(int b = 0; b < 10; b++) x += (1 << b) * getHint(b+1); if(x == start) { for(int y = 1; y <= N; y++) { if(y == x) continue; goTo(y); goTo(x); } } else { goTo(x); for(int y = 1; y <= N; y++) { if(y == x || y == start) continue; goTo(y); goTo(x); } } }
#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...