# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
263093 | Nightlight | Race (IOI11_race) | C++14 | 583 ms | 103124 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 "race.h"
#include <bits/stdc++.h>
#define pii pair<long long, int>
using namespace std;
int N;
long long K;
map<long long, int> mp[200005];
vector<pii> adj[200005];
long long dist[200005];
int cnt[200005];
int ans = 1000000000;
void DFS(int u, int p = N) {
int v;
long long w;
mp[u][dist[u]] = cnt[u];
for(pii now : adj[u]) {
v = now.second, w = now.first;
if(v == p) continue;
dist[v] = dist[u] + w;
cnt[v] = cnt[u] + 1;
DFS(v, u);
if(mp[v].size() > mp[u].size()) swap(mp[v], mp[u]);
}
long long jarak;
// cout << u << " -> " << dist[u] << " " << cnt[u] << "\n";
for(pii now : adj[u]) {
v = now.second;
if(v == p) continue;
# | 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... |