//#include "stations.h"//
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 + 23;
vector<int> g[MAXN];
int such, ft = 0;
vector<int> labels;
int dfs(int v, int p = -1, int nat = -1) {
// if (v == such) cout << v << p << nat << endl;
if (v == such) return nat;
for (auto i : g[v]) if (i != p) {
if (p == -1) {
int tmp = dfs(i, v, i);
if (tmp != -1) return tmp;
}
else {
int tmp = dfs(i, v, nat);
if (tmp != -1) return tmp;
}
}
return -1;
}
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
labels.clear();
for (int i = 0; i < n; i++) labels.push_back(i);
return labels;
}
int find_next_station(int s, int t, vector<int> c) {
if (ft == 0) for (int i = 0; i < MAXN - 3; i++) g[i / 2].push_back(i + 1), g[i + 1].push_back(i / 2);
ft++;
such = t;
return dfs(s);
}
/*
int main() {
for (auto i : label(3, 8, {0, 1}, {1, 2})) cout << i << endl;
cout << find_next_station(0, 2, {1});
return 0;
}*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
678 ms |
640 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
680 ms |
652 KB |
Output is correct |
2 |
Correct |
604 ms |
640 KB |
Output is correct |
3 |
Correct |
871 ms |
528 KB |
Output is correct |
4 |
Correct |
646 ms |
640 KB |
Output is correct |
5 |
Correct |
620 ms |
528 KB |
Output is correct |
6 |
Correct |
670 ms |
684 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
682 ms |
736 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
854 ms |
528 KB |
Output is correct |
2 |
Incorrect |
638 ms |
636 KB |
Wrong query response. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
659 ms |
640 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |