# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
430704 | 2021-06-17T01:24:00 Z | JUANDI321 | Stations (IOI20_stations) | C++17 | 1 ms | 408 KB |
#include "stations.h" #include <vector> using namespace std; vector<vector<int>> g; vector<int> l; bool ch[1000010]; void dfs(int node) { if(ch[node])return; l.push_back(node); for(auto y : g[node]) if(!ch[y]) dfs(y); } vector<int> label(int n, int k, vector<int> u, vector<int> v) { vector<int> labels(n); for(int i = 0; i < n-1; i++) { g[u[i]].push_back(v[i]); g[v[i]].push_back(u[i]); } int spn; for(int i = 0; i < n; i++) { if(g[i].size() == 1) { spn = i; break; } } dfs(spn); for (int i = 0; i < n; i++) { labels[l[i]] = i; } return labels; } int find_next_station(int s, int t, vector<int> c) { if(t>s)c[1]; return c[0]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 280 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 408 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 284 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 268 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 268 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |