#include <bits/stdc++.h>
#include "speedrun.h"
using namespace std;
const int MAXN=1e3+5;
vector<int> sos[MAXN][MAXN];
int cnt[MAXN];
vector<vector<int> > g(MAXN);
void assignHints(int subtask, int N, int A[], int B[]) {
setHintLen(N);
for(int i=1; i<N; i++) {
g[A[i]].push_back(B[i]);
g[B[i]].push_back(A[i]);
}
for(int i=1; i<=N; i++) {
for(auto to : g[i])setHint(i, to, 1);
}
return;
}
int us[MAXN];
void dfs(int v, int p, int N) {
us[v]=1;
vector<int> gg;
for(int j=1; j<=N; j++) {
if(getHint(j))gg.push_back(j);
}
for(auto to : gg) {
if(!us[to]) {
goTo(to);
dfs(to, v, N);
}
}
if(v!=p)goTo(p);
else return;
}
void speedrun(int subtask, int N, int start) {
int len=getLength();
dfs(start, start, N);
return;
}
Compilation message
speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:36:6: warning: unused variable 'len' [-Wunused-variable]
36 | int len=getLength();
| ^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
63 ms |
48192 KB |
Output is correct |
2 |
Correct |
62 ms |
48348 KB |
Output is correct |
3 |
Correct |
67 ms |
48188 KB |
Output is correct |
4 |
Correct |
67 ms |
48248 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
13 ms |
24056 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
15 ms |
24084 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
13 ms |
24016 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
24048 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |