# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
933593 | vjudge1 | Speedrun (RMI21_speedrun) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
bool vis[10000];
void dfs(int x, int p) {
vis[x] = true;
for(int i=1; i<=N; i++) {
if(getHint(i) && !vis[i]) {
goTo(i);
dfs(i, x);
}
}
goTo(p);
}
void assignHints(int subtask, int N, int A[], int B[]) {
setHintLen(N);
for(int i=1; i<N; i++) {
setHint(A[i], B[i], true);
setHint(B[i], A[i], true);
}
}
void speedrun(int subtask, int N, int start) {
dfs(start, start);
}