# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
768793 | 1075508020060209tc | Janjetina (COCI21_janjetina) | C++14 | 11 ms | 5988 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;
#define int long long
#define X first
#define Y second
int n;int K;
int uf[200005];
int usz[200005];
pair<int,pair<int,int>>e[200005];
int fin(int x){
if(uf[x]==x){return x;}
uf[x]=fin(uf[x]);
return uf[x];
}
void mrg(int a,int b){
int pa=fin(a);int pb=fin(b);
uf[pa]=pb;
usz[pb]+=usz[pa];
}
int ans;
vector<pair<int,int>>ee[200005];
int dph[200005];
void dfs(int nw,int pa,int mxv){
if(pa&&mxv-dph[nw]>=K){
ans++;
}
for(int i=0;i<ee[nw].size();i++){
int v=ee[nw][i].first;
if(v==pa){continue;}
int w=ee[nw][i].second;
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... |