# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
919237 | ibrahim001 | Monkey and Apple-trees (IZhO12_apple) | C++14 | 441 ms | 121128 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"
#define intt long long
using namespace std;
const intt inf = 1e18;
const int sz = 1e5+5;
int st[sz*80], lz[sz*80], L[sz*80], R[sz*80];
int last=1;
void check(int in){
if ( !L[in] ) L[in] = ++last;
if ( !R[in] ) R[in] = ++last;
}
void relax(int l, int r, int in){
if ( !lz[in] ) return;
st[in] = (r-l+1);
if ( l == r ){
lz[in]=0;
return;
}
check(in);
lz[L[in]] += lz[in];
lz[R[in]] += lz[in];
lz[in]=0;
}
void update(int a, int b, int l, int r, int in){
relax(l, r, in);
if ( l > b or r < a ) return;
if ( a <= l and r <= b ){
lz[in]++;
relax(l, r, in);
// cout << l << " " << r << " : " << st[in] << endl;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |