# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
211758 | mayhoubsaleh | Network (BOI15_net) | C++14 | 13 ms | 12160 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>
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
const ll inf=1e9+10;
const ll maxn=5e5+100;
int n;
vector<int>v[maxn],leaf;
int x[maxn],y[maxn];
vector<pair<int,int>>ans;
void dfs(int nod,int par){
if(v[nod].size()==1)leaf.pb(nod);
for(auto ch:v[nod]){
if(ch==par)continue;
dfs(ch,nod);
}
}
int d[2],dist[maxn][2];
pair<int,int>getfar(int nod,int par,int dep){
pair<int,int>ret={dep,nod};
for(auto ch:v[nod]){
if(ch==par)continue;
ret=max(ret,getfar(ch,nod,dep+1));
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |