# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
985485 | efishel | 기지국 (IOI20_stations) | C++17 | 641 ms | 1796 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector <ll>;
using vi = vector <int>;
static void dfs (ll u, ll par, ll dep, vi &ans, vector <vll> &adj, ll &timer) {
if (!(dep&1)) ans[u] = timer++;
for (ll v : adj[u]) {
if (v == par) continue;
dfs(v, u, dep+1, ans, adj, timer);
}
if (dep&1) ans[u] += timer++;
}
vi label (int n, int k, vi vu, vi vv) {
vector <vll> adj(n, vll({}));
for (ll i = 0; i < n-1; i++) {
adj[vu[i]].push_back(vv[i]);
adj[vv[i]].push_back(vu[i]);
}
vi ans(n);
ll timer = 0;
dfs(0, 0, 0, ans, adj, timer);
return ans;
}
int find_next_station (int s, int t, vi c) {
bool isTin = s < c[0];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |