# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
321597 | 2020-11-12T20:21:36 Z | keta_tsimakuridze | Stations (IOI20_stations) | C++14 | 898 ms | 896 KB |
#include <cstdio> #include "stations.h" #include <vector> #include<bits/stdc++.h> using namespace std; const int N=1005; int fix[N],timer; vector<int> V[N],labels; void dfs(int u,int h){ fix[u]=1; if(h%2==0) timer++,labels[u]=timer; for(int i=0;i<V[u].size();i++){ if(!fix[V[u][i]]){ dfs(V[u][i],h+1); } } if(h%2) timer++,labels[u]=timer;//cout<<u<<"__"<<labels[u]<<endl; } std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) { labels.resize(n); // cout<<"++++"; for (int i = 0; i < u.size(); i++) { V[u[i]].push_back(v[i]); V[v[i]].push_back(u[i]); } for(int i=0;i<n;i++){ if(!fix[i]){ dfs(i,0); } } return labels; } int find_next_station(int s, int t, std::vector<int> c) { // cout<<"++"; if(s<c[0]) { //inia es if(t>s){ for(int i=0;i<c.size()-1;i++){ if(t<=c[i]) return c[i]; } } return c[c.size()-1]; } else { if(t<s){ for(int i=c.size()-1;i>=1;i--) if(t>=c[i]) return c[i]; } return c[0]; } }//
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 492 KB | Invalid labels (duplicates values). scenario=2, label=0 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 492 KB | Invalid labels (duplicates values). scenario=3, label=0 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 492 KB | Invalid labels (duplicates values). scenario=3, label=0 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 898 ms | 864 KB | Output is correct |
2 | Incorrect | 825 ms | 896 KB | Wrong query response. |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 492 KB | Invalid labels (duplicates values). scenario=4, label=0 |
2 | Halted | 0 ms | 0 KB | - |