#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;
#define pb push_back
vector<int> g[2000];
void dfs(int v = 1, int p = 0){
if (p){
for (int i = 1; i <= 20; ++i){
if ((1 << (i - 1)) & p){
setHint(v, i, 1);
}
}
}
for (auto to : g[v]){
if (to != p){
dfs(to, v);
}
}
}
void assignHints(int subtask, int N, int A[], int B[]) { /* your solution here */
setHintLen(20);
for (int i = 1; i < N; ++i){
int x = A[i], y = B[i];
g[x].pb(y);
g[y].pb(x);
}
dfs();
}
void dfs2(int v, int p){
for (auto to : g[v]){
if (to != p){
goTo(to);
dfs2(to, v);
}
}
if (p){
goTo(p);
}
}
void speedrun(int subtask, int N, int start) { /* your solution here */
dfs2(start, 0);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
44 ms |
696 KB |
Solution didn't visit every node |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
28 ms |
672 KB |
Solution didn't visit every node |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
42 ms |
764 KB |
Solution didn't visit every node |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
38 ms |
736 KB |
Solution didn't visit every node |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
42 ms |
768 KB |
Solution didn't visit every node |
2 |
Halted |
0 ms |
0 KB |
- |