# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
954610 | Em1L | Race (IOI11_race) | C++17 | 335 ms | 81968 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "race.h"
using ll = long long;
using pii = std::pair<int, int>;
std::vector < std::vector < pii > > g;
std::vector < ll > dist;
std::vector < int > depth;
void DFS1(int v, int p, ll sum, int d) {
dist[v] = sum;
depth[v] = d;
for (auto [u, w] : g[v])
if (u != p)
DFS1(u, v, sum + w, d + 1);
}
int len, ans = INT_MAX;
std::map < ll, int > DFS2(int v, int p) {
std::map < ll, int > dp;
dp[dist[v]] = depth[v];
for (auto [u, w] : g[v])
if (u != p) {
auto sub = DFS2(u, v);
# | 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... |