# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
745801 | snpmrnhlol | Cat Exercise (JOI23_ho_t4) | C++17 | 345 ms | 63352 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>
using namespace std;
typedef long long ll;
const ll N = 2e5;
ll v[N],pos[N];
vector <ll> e[N];
struct DSU{
ll parent,score,maxx,power;
}v2[N];
ll leader(ll node){
if(v2[node].parent == node){
return node;
}else{
v2[node].parent = leader(v2[node].parent);
return v2[node].parent;
}
}
void connect(ll a,ll b){
a = leader(a);
b = leader(b);
if(v2[a].power > v2[b].power)swap(a,b);
v2[a].parent = b;
v2[b].power+=v2[a].power;
v2[b].score = max(v2[b].score,v2[a].score);
if(v[v2[b].maxx] < v[v2[a].maxx]){
v2[b].maxx = v2[a].maxx;
}
}
ll p[N][20],dpth[N];
void dfs(ll node,ll parent = 0,ll d = 0){
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |