# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
525816 | gg123_pe | 경주 (Race) (IOI11_race) | C++17 | 559 ms | 63864 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "race.h"
using namespace std;
typedef long long ll;
#define f(i,a,b) for(int i = a; i < b; i++)
#define ff first
#define ss second
const ll N = 1e6 + 5;
ll n, k, sz[N], ans = N, dist[N], dreal[N], aux[N];
bool on[N];
vector <pair<int,ll>> adj[N];
vector <int> ra;
int size(int u, int f){
sz[u] = 1;
for(auto v: adj[u]) if(v.first != f and !on[v.first]) sz[u] += size(v.first, u);
return sz[u];
}
int get_centroid(int u, int f, int curr_size){
for(auto v: adj[u]) if(v.first != f and !on[v.first] and sz[v.first]*2 > curr_size) return get_centroid(v.first, u, curr_size);
return u;
}
void get_tree(int u, int f){
ra.push_back(u);
for(auto v: adj[u]) if(v.first != f and !on[v.first]) get_tree(v.first, u);
}
void dfs(int u, int f){
# | 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... |