# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
39310 | chonka | Monkey and Apple-trees (IZhO12_apple) | C++98 | 546 ms | 215872 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<iostream>
#include<stdio.h>
using namespace std ;
struct Tree {
int IL , IR ;
int val ;
int lazy ;
Tree *pl , *pr ;
Tree ( int x , int y ) {
this->IL = x ;
this->IR = y ;
this->lazy = 0 ;
this->val = 0 ;
this->pl = this->pr = NULL ;
}
void push ( ) {
if ( this->IL == this->IR ) { return ; }
if ( this->pl != NULL ) { return ; }
int mid = ( this->IL + this->IR ) / 2 ;
this->pl = new Tree ( this->IL , mid ) ;
this->pr = new Tree ( mid + 1 , this->IR ) ;
}
void push_lazy ( ) {
if ( this->lazy == 0 ) { return ; }
this->val = ( this->IR - this->IL + 1 ) ;
if ( this->IL != this->IR ) {
this->pl->lazy = 1 ;
this->pr->lazy = 1 ;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |