#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1011;
vector<int> g[MAXN];
int tin[MAXN], timer = 0;
void dfs(int v, int p){
tin[v] = timer++;
for (int u : g[v]){
if (u != p) dfs(u, v);
}
}
vector<int> label(int n, int k, vector<int> U, vector<int> V) {
for (int i = 0; i < n - 1; i++){
g[U[i]].push_back(V[i]);
}
dfs(0, -1);
vector<int> labels(n, 0);
for (int i = 0; i < n; i++){
labels[i] = tin[i];
}
return labels;
}
int find_next_station(int s, int t, vector<int> c) {
if (c[0] >= t) return c[0];
int pos = upper_bound(c.begin(), c.end(), t) - c.begin() - 1;
return c[pos];
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1263 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3054 ms |
400 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1447 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1184 ms |
400 KB |
Output is correct |
2 |
Runtime error |
1158 ms |
2097156 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1254 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |