# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
998150 | alexdumitru | 경주 (Race) (IOI11_race) | C++14 | 264 ms | 39248 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "race.h"
#include <iostream>
#include <vector>
using namespace std;
const int NMAX = 2e5;
const int KMAX = 1e6;
vector<pair<int, int>> g[NMAX];
int w[NMAX];
bool used[NMAX];
int minDepth[KMAX + 1];
int Ans;
int get_w(int node, int dad) {
w[node] = 1;
for (auto it : g[node]) {
if (it.first == dad || used[it.first]) continue;
get_w(it.first, node);
w[node] += w[it.first];
}
return w[node];
}
int get_centroid(int node, int dad, int totalW) {
for (auto it : g[node]) {
if (it.first == dad || used[it.first]) continue;
if (w[it.first] > totalW / 2)
return get_centroid(it.first, node, totalW);
# | 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... |