# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
768092 | 2023-06-27T12:54:23 Z | 3RR0R404 | Stations (IOI20_stations) | C++14 | 1 ms | 556 KB |
#include <bits/stdc++.h> using namespace std; vector<int> child(1000,0); int l=0; set<int> visited; int dfs(int node,int d,vector<int> L,vector<vector<int>> adj) { visited.insert(node); L[node] = l; l++; int b=0; for(auto p: adj[node]) { if(visited.find(p)==visited.end()) { continue; } child[d] += dfs(p,l,L,adj); } return child[d]+1; } vector<int> label(int n,int k,vector<int> u,vector<int> v) { vector<vector<int>> adj(n); for(int i=0;i<n-1,i++;) { adj[u[i]].push_back(v[i]); adj[v[i]].push_back(u[i]); } vector<int> L(n,0); for(auto i: adj) { if(i.size() == 1); { dfs(i[0],0,L,adj); } break; } return L; } int find_next_station(int s, int t, vector<int> c) { sort(c.begin(),c.end()); if(s+child[s]<t) { return c[0]; } if(s>t) { return c[0]; } return *(upper_bound(c.begin(),c.end(),t)-1); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 336 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 556 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 336 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 428 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 432 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |