제출 #586035

#제출 시각아이디문제언어결과실행 시간메모리
586035wdjpng기지국 (IOI20_stations)C++17
0 / 100
783 ms544 KiB
#include<bits/stdc++.h> #include "stations.h" using namespace std; #define rep(i,n) for(int i = 0; i<((int)n);i++) int c; vector<vector<int>>E; vector<int>pre; void dfs(int v, int p) { pre[v]=c++; for(int w : E[v]) if(w!=p) dfs(w,v); } vector<int> label(int n, int k, std::vector<int> u, vector<int> v) { E=vector<vector<int>>(n); pre.assign(n,-1); c=0; rep(i,n-1) {E[u[i]].push_back(v[i]); E[v[i]].push_back(u[i]);} dfs(0,-1); return pre; } int find_next_station(int s, int t, vector<int> r) { vector<int>b=r; sort(b.begin(),b.end()); rep(i,b.size()-1) if(b[i+1]>t) return b[i]; return b[b.size()-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...