# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
619069 | HappyPacMan | Dynamic Diameter (CEOI19_diameter) | C++14 | 5116 ms | 426460 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>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx2")
using namespace std;
using ll = long long;
const int maxn = 1e5 + 3;
vector<pair<int,int> > adj[maxn],edges;
vector<int> partOf[maxn];
vector<ll> seg[maxn],lazy[maxn];
bool isCent[maxn];
int subSz[maxn],centRoot,timer[maxn];
map<int,int> tin[maxn],tout[maxn],edgeRoot[maxn];
set<pair<ll,int> > bestEdge[maxn],result;
ll cost[maxn];
void dfsSz(int u,int p){
subSz[u] = 1;
for(auto [v,w] : adj[u]){
if(v != p && !isCent[v]){
dfsSz(v,u);
subSz[u] += subSz[v];
}
}
}
int fnCent(int u,int p,int s){
for(auto [v,w] : adj[u]){
if(v != p && !isCent[v] && subSz[v] > s/2){
return fnCent(v,u,s);
}
Compilation message (stderr)
# | 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... |