# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
529553 | 2022-02-23T07:07:02 Z | pokmui9909 | Stations (IOI20_stations) | C++17 | 3000 ms | 2097156 KB |
#include "stations.h" #include <bits/stdc++.h> using namespace std; using ll = long long; ll in[1005], out[1005]; vector<ll> T[1005]; ll num = -1; void dfs(ll u, ll p){ in[u] = ++num; for(auto v : T[u]){ if(v == p) continue; dfs(v, u); } out[u] = num; } std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) { for(int i = 0; i < n - 1; i++){ T[u[i]].push_back(v[i]); T[v[i]].push_back(u[i]); } dfs(0, -1); vector<int> L(n); for(int i = 0; i < n; i++){ L[i] = in[i] * 1000 + out[i]; } return L; } int find_next_station(int s, int t, std::vector<int> c) { ll ls = s / 1000, rs = s % 1000, lt = t / 1000, rt = t % 1000; for(int i = 0; i < c.size(); i++){ ll k = c[i]; ll lk = k / 1000, rk = k % 1000; if(lk <= lt && rt <= rk) return k; } return -1; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1372 ms | 2097156 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3053 ms | 668 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1227 ms | 2097156 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 811 ms | 400 KB | Output is correct |
2 | Runtime error | 899 ms | 2097156 KB | Execution killed with signal 9 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2199 ms | 2097156 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |