# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
308345 | 2020-10-01T00:51:21 Z | chubyxdxd | Stations (IOI20_stations) | C++17 | 1202 ms | 1008 KB |
#include "stations.h" #include <bits/stdc++.h> #include <vector> using namespace std; vector<vector<int>> G; vector<int> gg; vector<int> labels; int id=0; void dfs(int node,int pad){ labels[node]=id; id++; for(auto i:G[node]){ if(i==pad)continue; dfs(i,node); } } vector<int> label(int n, int k,vector<int> u,vector<int> v) { G.clear(); G.assign(n+10,vector<int>()); for(int i=0;i<u.size();i++){ G[u[i]].push_back(v[i]); G[v[i]].push_back(u[i]); } int piv=0; labels.resize(n); for(int i=0;i<n;i++){ if(G[i].size()==1){ dfs(piv,-1); break; } } return labels; } int find_next_station(int s, int t,vector<int> c) { if(int(c.size())==1)return c[0]; if(t<s)return min(c[0],c[1]); else return max(c[0],c[1]); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 504 KB | Invalid labels (values out of range). scenario=2, k=1000, vertex=69, label=1001 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 368 KB | Invalid labels (values out of range). scenario=1, k=1000, vertex=2, label=1508 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 533 ms | 1008 KB | Wrong query response. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1202 ms | 640 KB | Output is correct |
2 | Incorrect | 786 ms | 640 KB | Wrong query response. |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 656 ms | 772 KB | Wrong query response. |
2 | Halted | 0 ms | 0 KB | - |