# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
385692 | 2021-04-04T18:13:52 Z | Ahmadsm2005 | Stations (IOI20_stations) | C++14 | 958 ms | 864 KB |
#include<bits/stdc++.h> #include "stations.h" using namespace std; int C; vector<vector<int>>edges; vector<int>labels; int DFS(int v,int u=-1){ int LAST=0,INIT=C; for(int i=0;i<edges[v].size();i++){ C+=10001; if(edges[v][i]!=u) LAST=DFS(edges[v][i],v); C-=10001; C--; } C=INIT; C-=LAST; labels[v]=100000000-C; return(100000000-C)%10001; } vector<int>label(int n,int k,vector<int>u,vector<int>v){ labels.clear(); labels.resize(n); edges.resize(n); for(int i=0;i<u.size();i++){ edges[u[i]].push_back(v[i]),edges[v[i]].push_back(u[i]); } DFS(0); C=0; edges.clear(); return labels; } int find_next_station(int s, int t,vector<int>c){ if((s/10001)<(t/10001)) return c.back(); for(int i=0;i<c.size();i++){ if(c[i]%10001>=t%10001) return c[i]; } return c.back(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 492 KB | Invalid labels (values out of range). scenario=0, k=1000, vertex=0, label=100000030 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 500 KB | Invalid labels (values out of range). scenario=0, k=1000, vertex=0, label=100009849 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 512 KB | Invalid labels (values out of range). scenario=0, k=1000000, vertex=0, label=100000001 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 958 ms | 756 KB | Output is correct |
2 | Correct | 734 ms | 756 KB | Output is correct |
3 | Incorrect | 642 ms | 736 KB | Wrong query response. |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 593 ms | 864 KB | Wrong query response. |
2 | Halted | 0 ms | 0 KB | - |