제출 #555354

#제출 시각아이디문제언어결과실행 시간메모리
555354ITO기지국 (IOI20_stations)C++17
0 / 100
712 ms668 KiB
#include "stations.h" #include <vector> #include <algorithm> using namespace std; vector<int> e[1000], lab; int co; void df(int no, int pa) { lab[no] = co++; for (int ed : e[no]) { if (ed != pa) df(ed, no); } } std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) { co = 0; lab.resize(n); for (int i = 0; i < n; i++) e[i].clear(); for (int i = 0; i < n - 1; i++) { e[u[i]].push_back(v[i]); e[v[i]].push_back(u[i]); } df(0, 0); return lab; } int find_next_station(int s, int t, std::vector<int> c) { if (t < s) return c[0]; return *(upper_bound(c.begin(), c.end(), t) - 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...