# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1081553 | _callmelucian | Progression (NOI20_progression) | C++14 | 961 ms | 104608 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;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> tt;
#define all(a) a.begin(), a.end()
#define filter(a) a.erase(unique(all(a)), a.end())
struct node {
ll lazyAsgn, lazyAdd, sum;
ll best, preLen, preVal, sufLen, sufVal, same, len;
node() : lazyAsgn(0), lazyAdd(0), sum(0), best(0), preLen(0), preVal(0), sufLen(0), sufVal(0), same(0), len(0) {}
void refine (node ln, node rn) {
best = max({ln.best, rn.best, (ln.sufLen + rn.preLen) * (ln.sufVal == rn.preVal)});
preLen = max(ln.preLen, (ln.len + rn.preLen) * (ln.same == rn.preVal));
preVal = ln.preVal;
sufLen = max(rn.sufLen, (ln.sufLen + rn.len) * (ln.sufVal == rn.same));
sufVal = rn.sufVal;
same = (ln.same == rn.same ? ln.same : LLONG_MAX);
sum = ln.sum + rn.sum, len = ln.len + rn.len;
}
void applyAsgn (ll val, int l, int r) {
lazyAsgn = val, lazyAdd = 0, sum = val * ll(r - l + 1);
best = preLen = sufLen = r - l + 1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |