# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1136332 | Drifter24 | Monkey and Apple-trees (IZhO12_apple) | C++17 | 308 ms | 205680 KiB |
#include <bits/stdc++.h>
using namespace std;
typedef long long T;
T null=0, noVal=0;
T oper(T a, T b){return a+b;}
struct Node{
T val,lz;
int l,r;
Node *pl,*pr;
Node(int ll, int rr){
val=null;lz=noVal;
pl=pr=nullptr;
l=ll;r=rr;
}
};
typedef Node* PNode;
void update(PNode x){
if(x->r-x->l==1)return;
x->val=oper(x->pl->val,x->pr->val);
}
void update2(PNode x){
x->val=(x->r-x->l);
x->lz=1;
}
void extends(PNode x){
if(x->r-x->l!=1 && !x->pl){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |