# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
337295 | ryangohca | Progression (NOI20_progression) | C++17 | 2278 ms | 86092 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 int long long
#define pii pair<int, int>
#define tpip tuple<pii, int, pii>
using namespace std;
struct node{
int s, e, m, sum, maxcos, lazyset, lazyadd;
bool lazyseton;
pii pref, suff;
node *l, *r;
node(int _s, int _e): s(_s), e(_e), m((_s+_e)/2), maxcos(0), lazyset(-1), lazyadd(0), sum(0), lazyseton(false){
if (s != e){
l = new node(s, m);
r = new node(m+1, e);
}
}
void value(){
if (lazyseton){
pref = suff = pii(lazyset+lazyadd, e-s+1);
sum = (lazyset + lazyadd) * (e-s+1);
if (s!=e){
l->lazyset = r->lazyset = lazyset;
l->lazyadd = r->lazyadd = lazyadd;
l->lazyseton = r->lazyseton = true;
}
lazyadd = 0;
lazyset = -1;
lazyseton = false;
maxcos = e - s + 1;
} else {
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |