# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
318818 | tushar_2658 | Monkey and Apple-trees (IZhO12_apple) | C++14 | 684 ms | 243044 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;
const int maxn = 100005;
struct NODE {
NODE *l, *r;
int val, lazy;
NODE(){
l = NULL; r = NULL; val = lazy = 0;
}
};
void push_down(NODE *cur, int b, int e){
if(cur -> lazy){
cur -> val = (e - b + 1);
if(cur -> l == NULL)cur -> l = new NODE();
if(cur -> r == NULL)cur -> r = new NODE();
cur -> l -> lazy = 1;
cur -> r -> lazy = 1;
cur -> lazy = 0;
}
}
void upd(NODE *cur, int b, int e, int i, int j){
push_down(cur, b, e);
if(i > e or j < b or i > j or b > e)return;
if(b >= i && j >= e){
cur -> lazy = 1;
push_down(cur, b, e);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |