# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
914491 | Tuanlinh123 | Worst Reporter 4 (JOI21_worst_reporter4) | C++17 | 303 ms | 105228 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>
#define ll long long
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ld long double
using namespace std;
const ll maxn=200005;
ll H[maxn], C[maxn];
map <ll, ll> cnt[maxn];
vector <ll> A[maxn];
void dfs(ll u)
{
for (ll v:A[u])
{
dfs(v);
if (cnt[u].size()<cnt[v].size())
swap(cnt[u], cnt[v]);
for (pll i:cnt[v])
cnt[u][i.fi]+=i.se;
}
ll crr=C[u]; cnt[u][H[u]]+=crr;
auto it=cnt[u].lower_bound(H[u]);
while (it!=cnt[u].begin())
{
it--;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |