# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
89812 | Vardanyan | Monkey and Apple-trees (IZhO12_apple) | C++17 | 935 ms | 261036 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;
struct node{
node* l;
node* r;
int val;
int lz;
node():l(NULL),r(NULL),val(0),lz(-1){}
};
void push(node* v,int s,int e){
if(v->lz!=-1){
v->val = (e-s+1)*(v->lz);
if(s!=e){
if(v->l == NULL){
v->l = new node();
v->r = new node();
}
v->l->lz = v->lz;
v->r->lz = v->lz;
}
}
v->lz = -1;
}
void update(node* v,int s,int e,int l,int r,int val){
push(v,s,e);
if(l>r) return;
if(s == l && e == r){
v->lz = val;
return;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |