From 0f84dd11d5c6c8f3b9fe6f7a4333c9b52d791312 Mon Sep 17 00:00:00 2001 From: hitonanode <32937551+hitonanode@users.noreply.github.com> Date: Sun, 28 Apr 2024 17:05:21 +0900 Subject: [PATCH] fix beats bug --- segmenttree/acl_beats.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/segmenttree/acl_beats.hpp b/segmenttree/acl_beats.hpp index 40504808..77c5e926 100644 --- a/segmenttree/acl_beats.hpp +++ b/segmenttree/acl_beats.hpp @@ -76,7 +76,7 @@ F composition(F fnew, F fold) { F id() { return F(); } S mapping(F f, S x) { if (x.sz == 0) return e(); - if (x.lo == x.hi or f.lb == f.ub or f.lb >= x.hi or f.ub < x.lo) + if (x.lo == x.hi or f.lb == f.ub or f.lb >= x.hi or f.ub <= x.lo) return S(std::min(std::max(x.lo, f.lb), f.ub) + f.bias, x.sz); if (x.lo2 == x.hi) { x.lo = x.hi2 = std::max(x.lo, f.lb) + f.bias, x.hi = x.lo2 = std::min(x.hi, f.ub) + f.bias;