# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
947015 | vjudge1 | Worst Reporter 4 (JOI21_worst_reporter4) | C++17 | 606 ms | 135252 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;
const int maxn=200000+10;
long long mainres,n,p[maxn],c[maxn],todor[maxn],vas[maxn];
set<long long>adj[maxn];
set<pair<long long,long long>>dp[maxn];
map<long long,long long>mp;
map<long long,long long>h[maxn];
void vorod(){
cin>>n;
for(long long i=1;i<=n;i++){
int d;
cin>>p[i]>>d>>c[i];
h[i][d]+=c[i];
mainres+=c[i];
if(i!=p[i]){
adj[p[i]].insert(i);
}
}
}
void merge(long long u,long long v){
long long fu=u;
if((long long)dp[u].size()<(long long)dp[v].size()){
swap(u,v);
}
for(auto x:dp[v]){
auto y=*dp[u].lower_bound(make_pair(x.first,-1));
if(y.first==x.first){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |