#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,e) for (int i = s; i <= e; ++i)
#define pb push_back
typedef vector<int> vi;
const int mxn = 2e4;
int id = 0, res[mxn];
vi neibs[mxn];
void dfs (int u, int prev) {
for (int v : neibs[u]) {
if (v==prev) continue;
dfs (v, u);
}
res[u]=id++;
}
vi label (int n, int k, vi u, vi v) {
rep (i,0,n-2) {
neibs[u[i]].pb(v[i]);
neibs[v[i]].pb(u[i]);
}
dfs (0,-1);
vi L(n);
rep (i,0,n-1) L[i] = res[i];
return L;
}
int find_next_station (int s, int t, vi c) {
sort(c.begin(), c.end());
for (int v : c) if (v>=t) return v;
return c.back();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1860 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3065 ms |
880 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1852 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1107 ms |
1424 KB |
Output is correct |
2 |
Runtime error |
1357 ms |
2097156 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3142 ms |
1673648 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |