# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
385700 | 2021-04-04T18:41:47 Z | Ahmadsm2005 | Stations (IOI20_stations) | C++14 | 1115 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){ int INIT=C; for(int i=0;i<edges[v].size();i++){ C+=10001; if(edges[v][i]!=u) DFS(edges[v][i],v); C-=10001; C++; } C=INIT; labels[v]=C; C+=1001; } 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[0]; for(int i=c.size()-1;i>=0;i--){ if((c[i]%10001)/1001<=(t%10001)/1001) return c[i]; } return c[0]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 492 KB | Invalid labels (values out of range). scenario=0, k=1000, vertex=1, label=51009 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 500 KB | Invalid labels (values out of range). scenario=0, k=1000, vertex=1, label=10001 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 492 KB | Invalid labels (values out of range). scenario=1, k=1000000, vertex=1, label=2510370 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1115 ms | 756 KB | Output is correct |
2 | Correct | 830 ms | 756 KB | Output is correct |
3 | Incorrect | 653 ms | 756 KB | Wrong query response. |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 662 ms | 884 KB | Wrong query response. |
2 | Halted | 0 ms | 0 KB | - |