# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
430708 | 2021-06-17T01:43:23 Z | JUANDI321 | Stations (IOI20_stations) | C++17 | 885 ms | 56336 KB |
#include "stations.h" #include <vector> #include <iostream> using namespace std; vector<vector<int>> g(1e6+10); vector<int> l(1e6 +10); bool ch[1000010]; void dfs(int node, int i) { if(ch[node])return; //cout<<"holis"<<endl; ch[node]=true; l[i] = node; //cout<<node<<endl; for(auto y : g[node]) { if(!ch[y]) { dfs(y, i+1); } } } 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, 0);//cout<<"hola"<<endl; for (int i = 0; i < n; i++) { labels[l[i]] = i; // cout<<"l[i] "<<l[i]<<" i "<<i<<endl; } return labels; } int find_next_station(int s, int t, vector<int> c) { if(t>s)return c[1]; return c[0]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 44 ms | 56088 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 40 ms | 56052 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 45 ms | 56336 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 885 ms | 55288 KB | Wrong query response. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 42 ms | 56212 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |