Skip to content

Commit

Permalink
fix error in Lazy Segment Tree Increment Update Query Max
Browse files Browse the repository at this point in the history
  • Loading branch information
iagorrr committed Aug 13, 2024
1 parent 4284298 commit f763782
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ inline QueryT combine(QueryT ln, QueryT rn, pii lr1, pii lr2){
using LazyT=SegT;

inline QueryT applyLazyInQuery(QueryT q, LazyT l, pii lr){
if(q.v==QueryT().v)q.v=0;
q.v+=l;
return q;
}
Expand All @@ -26,6 +27,7 @@ inline LazyT applyLazyInLazy(LazyT a,LazyT b){
using UpdateT=SegT;

inline QueryT applyUpdateInQuery(QueryT q,UpdateT u, pii lr){
if(q.v==QueryT().v)q.v=0;
q.v+=u;
return q;
}
Expand Down

0 comments on commit f763782

Please sign in to comment.