# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
432611 | 2021-06-18T11:36:45 Z | saleh | Stations (IOI20_stations) | C++17 | 2780 ms | 2097156 KB |
#include "stations.h" #include <bits/stdc++.h> using namespace std; const int MAXN = 1000 + 23; vector<int> g[MAXN]; vector<int> labels; int cnt = 0; void dfs(int v, int p = -1) { labels[v] = cnt++; for (auto i : g[v]) if (i != p) dfs(i, v); } vector<int> label(int n, int k, vector<int> u, vector<int> v) { for (int i = 0; i < n; i++) labels.push_back(0); for (int i = 0; i < n - 1; i++) { g[u[i]].push_back(v[i]), g[v[i]].push_back(u[i]); } for (int i = 0; i < n; i++) if (g[i].size() == 1) { dfs(i); break; } assert(labels.size() == n); return labels; } int find_next_station(int s, int t, vector<int> c) { if (s < t) return s + 1; return s - 1; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 436 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 556 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1689 ms | 2097156 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 456 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2780 ms | 2097156 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |