# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
945468 | 4QT0R | Dreaming (IOI13_dreaming) | C++17 | 60 ms | 18384 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 "dreaming.h"
using namespace std;
vector<pair<int,int>> graph[100003];
int odl[100003];
int comp[100003];
vector<int> diameter[100003];
int len[100003];
int iter=0,mx_odl,mx_ver,ans=0;
void dfs(int v, int p){
comp[v]=iter;
if (odl[v]>mx_odl){
mx_odl=odl[v];
mx_ver=v;
}
for (auto u : graph[v]){
if (u.first==p)continue;
odl[u.first]=odl[v]+u.second;
dfs(u.first,v);
}
}
void farthest(int v){
mx_odl=mx_ver=-1;
odl[v]=0;
dfs(v,-1);
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |