제출 #592171

#제출 시각아이디문제언어결과실행 시간메모리
592171PiejanVDC기지국 (IOI20_stations)C++17
0 / 100
783 ms612 KiB
#include <bits/stdc++.h> #include "stations.h" using namespace std; vector<int>label(int n, int k, vector<int>u, vector<int>v) { vector<int>adj[n]; for(int i = 0 ; i < (int)u.size() ; i++) { adj[u[i]].push_back(v[i]); adj[v[i]].push_back(u[i]); } int start; for(int i = 0 ; i < n ; i++) { if((int)adj[i].size() == 1) start = i; } vector<int>l(n); vector<bool>vis(n, 0); for(int i = 0 ; i < n ; i++) { vis[start] = 1; l[start] = i; for(auto z : adj[start]) if(!vis[z]) start = z; } return l; } int find_next_station(int s, int t, vector<int>c) { if(s < t) return c[1]; return c[0]; }
#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...