# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
726062 | piOOE | Worst Reporter 4 (JOI21_worst_reporter4) | C++17 | 1660 ms | 478360 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;
using ll = long long;
constexpr int N_ = 8e5 * 20 * 2 + 1;
int top = 1;
struct Node {
ll sum = 0, mxp = 0;
int left = 0, right = 0;
} t[N_];
int create() {
return top++;
}
void pull(int x) {
int l = t[x].left, r = t[x].right;
t[x].sum = t[l].sum + t[r].sum;
t[x].mxp = max(t[l].mxp, t[l].sum + t[r].mxp);
}
void modify(int x, int lx, int rx, int i, ll d) {
if (lx == i && rx == i + 1) {
t[x].sum += d;
t[x].mxp = max(t[x].sum, 0LL);
return;
}
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... |