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>
#include "speedrun.h"
using namespace std;
bool vis[10000];
void dfs(int x, int p, int N) {
vis[x] = true;
for(int i=1; i<=N; i++) {
if(getHint(i) && !vis[i]) {
goTo(i);
dfs(i, x, N);
}
}
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, N);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |