Submission #772453

#TimeUsernameProblemLanguageResultExecution timeMemory
772453SanguineChameleonStations (IOI20_stations)C++17
8 / 100
781 ms580 KiB
#include "stations.h" #include <bits/stdc++.h> using namespace std; const int maxn = 1e3 + 20; vector<int> adj[maxn]; int tin[maxn]; int tout[maxn]; int dfs_t; void dfs(int u, int p) { tin[u] = ++dfs_t; for (auto v: adj[u]) { if (v != p) { dfs(v, u); } } tout[u] = dfs_t; } vector<int> label(int n, int k, vector<int> u, vector<int> v) { vector<int> labels(n); for (int i = 0; i < n; i++) { labels[i] = i; } return labels; } int find_next_station(int s, int t, vector<int> c) { while (t != 0) { if ((t - 1) / 2 == s) { return t; } t = (t - 1) / 2; } return (s - 1) / 2; }
#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...