# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
306907 | 2020-09-26T14:15:18 Z | giorgikob | Stations (IOI20_stations) | C++14 | 919 ms | 1008 KB |
#include "stations.h" #include <vector> #include<bits/stdc++.h> #define ll long long #define ff first #define ss second #define pb push_back using namespace std; const int N = 1e3+5; vector<int>gr[N]; int cnt = 0; int fix[N]; //int c = 0; void dfs(int x, vector<int>&v){ fix[x] = 1; for(auto to : gr[x]){ if(fix[to]) continue; dfs(to,v); } v[x] = cnt; cnt++; } std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) { std::vector<int> labels(n,0); //for(int i = 0; i < n; i ++ ) labels[i] = i; for(int i = 0; i < u.size(); i++){ int x = u[i]; int y = v[i]; gr[x].pb(y); gr[y].pb(x); } /*cnt = 0; for(int i = 0; i < n; i++){ if(gr[i].size() == 1){ dfs(i,labels); break; } } */ dfs(0,labels); //if(labels[0] == 0) dfs(0,labels); //for(auto x : labels) cout << x <<" "; cout << endl; for(int i = 0; i < n; i++) gr[i].clear(), fix[i] = 0; return labels; } int find_next_station(int s, int t, std::vector<int> c) { //if(c.size() == 1) return c[0]; //if(s > t) return c[0]; if(s < t) return c[2]; if(c[0] >= t) return c[0]; return c[1]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 384 KB | Invalid labels (values out of range). scenario=2, k=1000, vertex=0, label=1010 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 384 KB | Invalid labels (values out of range). scenario=1, k=1000, vertex=0, label=1989 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 576 ms | 772 KB | Wrong query response. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 919 ms | 768 KB | Wrong query response. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 528 ms | 1008 KB | Wrong query response. |
2 | Halted | 0 ms | 0 KB | - |