#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define SZ(x) (int)(x).size()
#define all(x) begin(x), end(x)
int T;
vector <int> g[1003], ind, d;
void dfs(int v, int p) {
if (!d[v]) ind[v] = T++;
for (int to : g[v]) {
if (to == p) continue;
d[to] = d[v] ^ 1;
dfs(to, v);
}
if (d[v]) ind[v] = T++;
}
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
ind.resize(n);
d.resize(n);
for (int i = 0; i < SZ(u); i++)
g[u[i]].pb(v[i]), g[v[i]].pb(u[i]);
d[0] = 0;
dfs(0, 0);
return ind;
}
int find_next_station(int s, int t, vector<int> c) {
for (int i = 0; i < SZ(c) - 1; i++)
if (t >= s && t <= c[i])
return c[i];
return c.back();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1544 ms |
2097156 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3074 ms |
500 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1503 ms |
2097156 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
941 ms |
768 KB |
Output is correct |
2 |
Runtime error |
1235 ms |
2097156 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2595 ms |
2097156 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |