# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
417058 | tqbfjotld | Worst Reporter 4 (JOI21_worst_reporter4) | C++14 | 390 ms | 61656 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
int h[200005];
int c[200005];
vector<int> adjl[200005];
int in_cycle[200005];
///pos, increase
set<pair<int,int> > func(int node, bool fin = true){
set<pair<int,int> > res1;
for (auto x : adjl[node]){
if (in_cycle[x]) continue;
auto res = func(x);
if (res.size()>res1.size()) swap(res,res1);
for (auto y : res){
auto it = res1.lower_bound({y.first,-1});
if (it!=res1.end() && (*it).first==y.first){
int t = (*it).second;
res1.erase(it);
res1.insert({y.first,y.second+t});
}
else{
res1.insert({y.first,y.second});
}
}
}
if (!fin) return res1;
pair<int,int> to_insert = {h[node]+1,c[node]};
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... |