# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
379835 | huynhtrankhanh | 경주 (Race) (IOI11_race) | C++17 | 563 ms | 48236 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int best_path(int n, int k, int h[][2], int l[])
{
const int maxn = 200001;
const int inf = 0x3f3f3f3f;
vector<pair<int, int>> graph[maxn];
for (int i = 0; i < n - 1; i++)
{
int u = h[i][0];
int v = h[i][1];
int w = l[i];
graph[u].emplace_back(v, w);
graph[v].emplace_back(u, w);
}
int size[maxn];
bool ignored[maxn];
memset(ignored, 0, sizeof(ignored));
auto get_centroid = [&](int root) {
{
auto dfs = [&](auto dfs, int vertex, int parent) -> void {
size[vertex] = 0;
for (auto [adjacent, _]: graph[vertex])
if (adjacent != parent) if (!ignored[adjacent])
# | 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... |