Submission #768042

#TimeUsernameProblemLanguageResultExecution timeMemory
768042NicolaikrobStations (IOI20_stations)C++17
0 / 100
3 ms592 KiB
#include <bits/stdc++.h> using namespace std; vector<vector<int>> G; vector<bool> V; vector<int> L; int dfs(int v, int d) { V[v] = 0; L[v] = d; for(auto x : G[v]) if(V[x]) return dfs(x, d+1); return v; } vector<int> label(int n, int k, vector<int> u, vector<int> v) { G.resize(n); V.resize(n, 1); L.resize(n); for(int i = 0; i < n-1; i++) { G[u[i]].push_back(v[i]); G[v[i]].push_back(u[i]); } dfs(dfs(0, 0), 0); return L; } int find_next_station(int s, int t, vector<int> c) { if(size(c) == 1) return c[0]; if(t > s) return max(c[0], c[1]); else return min(c[0], c[1]); } /* int main() { int n; cin >> n; } */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...