# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
536931 | 2022-03-14T07:52:10 Z | joelau | Speedrun (RMI21_speedrun) | C++14 | 56 ms | 728 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 20 ms | 600 KB | Solution didn't visit every node |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 36 ms | 724 KB | Output is correct |
2 | Correct | 38 ms | 720 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 16 ms | 728 KB | Solution didn't visit every node |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 56 ms | 684 KB | Solution didn't visit every node |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 55 ms | 676 KB | Solution didn't visit every node |
2 | Halted | 0 ms | 0 KB | - |