# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1020924 | mdn2002 | Distributing Candies (IOI21_candies) | C++17 | 0 ms | 0 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.
/*
Mayoeba Yabureru
*/
#include<bits/stdc++.h>
#include <pstl/execution_impl.h>
using namespace std;
struct Node {
int valuel = 0, valuer = 0, lazyadd = 0, lazyset = -1;
int left = -1, right = -1;
Node() {}
};
Node st[5000006];
int cnt;
void push(int node, int l, int r) {
int left = st[node].left, right = st[node].right;
if (st[node].lazyset != -1) {
//cout << '*' << l << ' ' << r << ' ' << st[node].lazyset << ' ' << st[node].lazyadd << endl;
if (st[node].lazyset == 0) {
st[node].valuel = 0;
st[node].valuer = 0;
}
else {
st[node].valuel = l;
st[node].valuer = r;
}
st[node].valuel += st[node].lazyadd;
st[node].valuer += st[node].lazyadd;
if (l != r) {
st[left].lazyset = st[right].lazyset = st[node].lazyset;