Submission #536931

#TimeUsernameProblemLanguageResultExecution timeMemory
536931joelauSpeedrun (RMI21_speedrun)C++14
8 / 100
56 ms728 KiB
#include "speedrun.h" #include <bits/stdc++.h> using namespace std; void assignHints(int subtask, int N, int A[], int B[]) { int deg[N+5]; memset(deg,0,sizeof(deg)); for (int i = 1; i < N; ++i) deg[A[i]]++, deg[B[i]]++; int x = 1; for (int i = 1; i <= N; ++i) if (deg[i] > deg[x]) x = i; setHintLen(20); for (int i = 0; i < 20; ++i) for (int j = 1; j <= N; ++j) if (x & (1<<i)) setHint(j,i+1,1); } void speedrun(int subtask, int N, int start) { int len = getLength(); bitset<1005> visited; visited[start] = 1; int x = 0; for (int i = 0; i < 20; ++i) if (getHint(i+1)) x |= (1<<i); if (start != x) goTo(x), visited[x] = 1; for (int i = 1; i <= N; ++i) if (!visited[i]) goTo(i), goTo(x); }

Compilation message (stderr)

speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:16:9: warning: unused variable 'len' [-Wunused-variable]
   16 |     int len = 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...