# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
89809 | Vardanyan | Monkey and Apple-trees (IZhO12_apple) | C++14 | 570 ms | 133340 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{
int val,lz;
};
const int N = 1000*1000+5;
node t[10*N];
int son1[10*N];
int son2[10*N];
int timer = 1;
void push(int v,int s,int e){
if(t[v].lz!=0){
t[v].val = (e-s+1)*(t[v].lz);
if(s!=e){
if(son1[v] == 0){
son1[v] = ++timer;
son2[v] = ++timer;
}
t[son1[v]].lz = 1;
t[son2[v]].lz = 1;
// t[son1[v]]->lz = t[v].lz;
//t[v].r->lz = t[v].lz;
}
}
t[v].lz = 0;
}
void update(int v,int s,int e,int l,int r,int val){
push(v,s,e);
if(l>r) return;
if(s == l && e == r){
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |