# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
18612 | mindol | Monkey and Apple-trees (IZhO12_apple) | C++14 | 676 ms | 260324 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<cstdio>
struct Node
{
int value = 0; bool lazy = false;
Node *left = nullptr, *right = nullptr;
};
void lazydown(Node *now,int now_l,int now_r)
{
if(!now->lazy) return;
now->value = now_r-now_l+1;
now->lazy = false;
if(now_l==now_r) return;
if(now->left == nullptr) now->left = new Node();
now->left->lazy = true;
if(now->right == nullptr) now->right = new Node();
now->right->lazy = true;
}
void check(int l,int r,Node *now,int now_l,int now_r)
{
lazydown(now,now_l,now_r);
if(now_l>r || now_r<l) return;
else if(l<=now_l && now_r<=r) now->lazy = true, lazydown(now,now_l,now_r);
else
{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |