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 sz = 2005;
int cnt = 0, used[sz];
vector<int> g[sz];
void dfs(int v, int p)
{
used[v] = 1;
for(int i : g[v])
{
if(!used[i])
{
goTo(i);
dfs(i, v);
}
}
if(p > 0 )
{
goTo(p);
}
}
void assignHints(int subtask, int N, int A[], int B[])
{
for(int i = 1; i <= N - 1; i++)
{
g[A[i]].push_back(B[i]);
g[B[i]].push_back(A[i]);
}
setHintLen(1);
}
void speedrun(int subtask, int N, int start)
{
dfs(start, -1);
}
# | 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... |