# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
306750 | 2020-09-26T08:40:03 Z | VEGAnn | 기지국 (IOI20_stations) | C++14 | 3000 ms | 2097156 KB |
#include "stations.h" #include <bits/stdc++.h> #define PB push_back #define sz(x) ((int)x.size()) using namespace std; const int N = 1000; vector<int> g[N]; int tin[N], tout[N], tt = 0; void dfs(int v, int p){ tin[v] = tt++; for (int u : g[v]){ if (u == p) continue; dfs(u, v); } tout[v] = tt - 1; } std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) { for (int i = 0; i < sz(u); i++){ g[u[i]].PB(v[i]); g[v[i]].PB(u[i]); } dfs(0, -1); vector<int> labels; labels.resize(n); for (int i = 0; i < n; i++) { labels[i] = tin[i] * N + tout[i]; // cerr << labels[i] << '\n'; } return labels; } int find_next_station(int s, int t, std::vector<int> c) { int tin_s = s / N; int tout_s = s % N; int tin_t = t / N; int tout_t = t % N; if (tin_s <= tin_t && tout_s >= tout_t){ for (int v : c) { int tin_v = v / N; int tout_v = v % N; if (tin_v > tin_s && tin_v <= tin_t && tout_v >= tout_v) return v; } } else { for (int v : c) if (v / N < tin_s) return v; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1594 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 | 3056 ms | 624 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1740 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 | 884 ms | 784 KB | Output is correct |
2 | Runtime error | 1311 ms | 2097156 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3036 ms | 2097152 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |