#include <bits/stdc++.h>
#include "speedrun.h"
using namespace std;
void dfs1(int u, int N, bool flag[]) {
for (int i = 1; i <= N; i++) {
if (getHint(i) && !flag[i]) {
flag[i] = true;
goTo(i);
dfs1(i, N, flag);
goTo(u);
}
}
}
void ass1(int N, int A[], int B[]) {
setHintLen(N);
for (int i = 1; i <= N - 1; i++) {
setHint(A[i], B[i], 1);
setHint(B[i], A[i], 1);
}
}
void speed1(int N, int start) {
bool flag[N];
fill_n(flag, N, false);
dfs1(start, N, flag);
}
void assignHints(int subtask, int N, int A[], int B[]) { /* your solution here */
if (subtask == 1) {
ass1(N, A, B);
}
}
void speedrun(int subtask, int N, int start) { /* your solution here */
if (subtask == 1) {
speed1(N, start);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
780 KB |
Output is correct |
2 |
Correct |
36 ms |
784 KB |
Output is correct |
3 |
Correct |
45 ms |
764 KB |
Output is correct |
4 |
Correct |
42 ms |
872 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
setHintLen was never called |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
setHintLen was never called |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
setHintLen was never called |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
setHintLen was never called |
2 |
Halted |
0 ms |
0 KB |
- |