# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
914630 | minhnhatnoe | Worst Reporter 4 (JOI21_worst_reporter4) | C++17 | 6 ms | 13400 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;
int a[MAXN], h[MAXN], c[MAXN], deg[MAXN], n;
map<int, long long> s[MAXN];
vector<int> q;
void cdeg(int v){
if (deg[v]) return;
auto it = s[v].lower_bound(h[v]);
if (it == s[v].end() || it->first != h[v])
it = s[v].emplace_hint(it, h[v], 0);
it->second += c[v];
for (int x = c[v]; it != s[v].begin() && x;){
it--;
if (it->second <= x){
x -= it->second;
it = s[v].erase(it);
}
else{
it->second -= x;
x = 0;
}
}
q.push_back(v);
}
void merge(map<int, long long> &a, map<int, long long> &b){
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... |