#include "speedrun.h"
#include <iostream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <bitset>
using namespace std;
void assignHints(int subtask, int N, int A[], int B[]) { /* your solution here */
setHintLen(N);
for (int i = 1; i < N; ++i){
int x = A[i], y = B[i];
setHint(x, y, 1);
setHint(y, x, 1);
}
}
void dfs(int v, int p, int sz){
for (int j = 1; j <= sz; ++j){
if (j != p && getHint(j)){
goTo(j);
dfs(j, v, sz);
}
}
if (p){
goTo(p);
}
}
void speedrun(int subtask, int N, int start) { /* your solution here */
dfs(start, 0, N);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
37 ms |
808 KB |
Output is correct |
2 |
Correct |
39 ms |
784 KB |
Output is correct |
3 |
Correct |
44 ms |
804 KB |
Output is correct |
4 |
Correct |
30 ms |
800 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
336 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
336 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
336 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |