Submission #1009878

#TimeUsernameProblemLanguageResultExecution timeMemory
1009878dimashhhStations (IOI20_stations)C++17
0 / 100
600 ms10184 KiB
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 12; vector<int> g[N],ord; bool vis[N]; void dfs(int v,int pr = -1){ for(int to:g[v]){ if(to != pr){ dfs(to,v); } } ord.push_back(v); } vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v){ vector<int> lab(n); for(int i = 0;i < n;i++){ lab[i] = i; } for(int i = 0;i < n - 1;i++){ g[u[i]].push_back(v[i]); g[v[i]].push_back(u[i]); } for(int i = 0;i < n;i++){ if((int)g[i].size() == 1){ // dfs(i); break; } } // for(int i = 0;i < (int)lab.size();i++){ // lab[ord[i]] = i; // } return lab; } int find_next_station(int s, int t, std::vector<int> c){ if(s < t)return s + 1; return s - 1; }
#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...