#include "speedrun.h"
#include <bits/stdc++.h>
void assignHints(int subtask, int N, int A[], int B[]) { /* your solution here */
if (subtask == 1){
setHintLen(N);
for (int x = 1; x < N; x++){
setHint(A[x], B[x], 1);
setHint(B[x], A[x], 1);
}
}
return;
}
bool vis[1007];
int n;
void dfs(int x, int p){
vis[x] = 1;
for (int y = 1; y <= n; y++){
if ( (!vis[y]) && getHint(y)){
goTo(y);
dfs(y, x);
goTo(x);
}
}
}
void speedrun(int subtask, int N, int start) { /* your solution here */
n = N;
int length = getLength();
if (subtask == 1){
memset(vis, 0, sizeof(vis));
dfs(start, -1);
}
return;
}
Compilation message
speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:32:6: warning: unused variable 'length' [-Wunused-variable]
32 | int length = getLength();
| ^~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
1020 KB |
Output is correct |
2 |
Correct |
24 ms |
1968 KB |
Output is correct |
3 |
Correct |
24 ms |
1412 KB |
Output is correct |
4 |
Correct |
25 ms |
1592 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
setHintLen was never called |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
setHintLen was never called |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
setHintLen was never called |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
setHintLen was never called |
2 |
Halted |
0 ms |
0 KB |
- |