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 "speedrun.h"
#include <bits/stdc++.h>
using namespace std;
const int nx=1e3+5;
int vs[nx], n;
void dfs(int u, int p)
{
//cout<<"u "<<u<<'\n';
vs[u]=1;
for (int i=1; i<=n; i++) if (!vs[i]&&getHint(i)) goTo(i), dfs(i, u);
if (u!=p) 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], 1), setHint(B[i], A[i], 1); //cout<<"edge "<<A[i-1]<<' '<<B[i-1]<<'\n';
}
void speedrun(int subtask, int N, int start) {
n=N;
dfs(start, start);
}
# | 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... |