#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 |
1 |
Incorrect |
8 ms |
768 KB |
Solution didn't visit every node |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |