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 NN=1005;
bool vis[NN];
int n;
void dfs(int x,int p){
//cout<<x<<' '<<p<<endl;
vis[x]=1;
for (int i=1;i<=n;i++){
if (vis[i]) continue;
if (!getHint(i)) continue;
goTo(i);
dfs(i,x);
}
if (p) goTo(p);
return;
}
void assignHints(int subtask, int N, int A[], int B[]) {
n=N;
setHintLen(n);
for (int i=1;i<n;i++){
setHint(A[i],B[i],1);
setHint(B[i],A[i],1);
}return;
}
void speedrun(int subtask, int N, int start) {
dfs(start,0);
return;
}
# | 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... |