# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
385687 | 2021-04-04T17:56:06 Z | Ahmadsm2005 | Stations (IOI20_stations) | C++14 | 1005 ms | 884 KB |
#include<bits/stdc++.h> #include "stations.h" using namespace std; int C; vector<vector<int>>edges; vector<int>labels; void DFS(int v,int u=-1){ for(int i=0;i<edges[v].size();i++){ C+=1001; if(edges[v][i]!=u) DFS(edges[v][i],v); C-=1001; C++; } C--; labels[v]=100000000-C; } 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/1001)<(t/1001)) return c.back(); for(int i=0;i<c.size();i++){ if(c[i]%1001>=t%1001) return c[i]; } return c.back(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 644 KB | Invalid labels (values out of range). scenario=0, k=1000, vertex=0, label=99999992 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 476 KB | Invalid labels (values out of range). scenario=0, k=1000, vertex=0, label=99999006 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 492 KB | Invalid labels (values out of range). scenario=0, k=1000000, vertex=0, label=100000000 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1005 ms | 756 KB | Output is correct |
2 | Correct | 855 ms | 768 KB | Output is correct |
3 | Incorrect | 645 ms | 756 KB | Wrong query response. |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 610 ms | 884 KB | Wrong query response. |
2 | Halted | 0 ms | 0 KB | - |