제출 #429246

#제출 시각아이디문제언어결과실행 시간메모리
429246abdzag기지국 (IOI20_stations)C++17
0 / 100
1000 ms468 KiB
#include<bits/stdc++.h> #include<unordered_map> #include<unordered_set> #include "stations.h" #define rep(i,a,b) for(int i=int(a);i<int(b);i++) #define rrep(i,a,b) for(int i=int(a);i>int(b);i--) #define trav(a,v) for(auto& a: v) #define sz(v) v.size() #define all(v) v.begin(),v.end() #define vi vector<int> typedef long long ll; typedef long double ld; typedef unsigned long long ull; const long long inf = 2e9; using namespace std; vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) { ll counter = 0; vector<vector<ll>> g(n); rep(i, 0, n - 1) { g[u[i]].push_back(v[i]); g[v[i]].push_back(u[i]); } ll cur = 0; rep(i, 0, g.size()) { if (g[i].size() == 1)cur = i; } vector<int> ans(n); while (counter < n) { ans[cur] = counter++; } return ans; } int find_next_station(int s, int t, vector<int> c) { int ans; if (s < t) { ans = -1; trav(a, c)ans = max(a, ans); } else { ans = 1e7; trav(a, c)ans = min(a, ans); } return ans; }
#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...