제출 #780773

#제출 시각아이디문제언어결과실행 시간메모리
780773jasmin기지국 (IOI20_stations)C++17
0 / 100
734 ms544 KiB
#include "stations.h" #include <bits/stdc++.h> using namespace std; int mom=0; void dfs(int v, int p, vector<vector<int> >& adi, vector<int>& label){ label[v]=mom; mom++; for(auto u: adi[v]){ if(u==p) continue; dfs(u, v, adi, label); } } vector<int> label(int n, int k, vector<int> u, vector<int> v) { vector<vector<int> > adi(n); for(int i=0; i<n-1; i++){ adi[v[i]].push_back(u[i]); adi[u[i]].push_back(v[i]); } vector<int> labels(n, 0); dfs(0, -1, adi, labels); return labels; } int find_next_station(int s, int t, vector<int> c) { //sort(c.begin(), c.end()); int next=c[0]; for(auto u: c){ if(u<=t){ next=u; } } return next; }
#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...