Atcoder Library Lazy Segment Tree Implementation Bug (Probably)

Правка en3, от KnightKnight, 2023-05-02 08:21:55

With Atcoder API of Lazy Segment Tree, Lazy Seg Tree Template
I am trying the problem where we need to support query to increment a range with a given value.

The Atcoder API implementation seems to fail here, where I have an array.

[3, 2, 4, 5, 1, 1, 5, 3]

and I want to do a range update over the range [1,4] ( 0 based indexing) and add a value 1 to it.
The sum should ideally change to 16 after the update and the array should look like

[3, 3, 5, 6, 2, 1, 5, 3]

The query function , the .prod() function of Atcoder API seems to return result 15,
You can try running this code for your reference to understand the ambiguity happening here.

Code
Output


I am using CPP20 and I am pretty sure (almost 99%) that it is a bug in their implementation,
just want someone to acknowledge it or maybe tell what am I missing here.
cc yosupo

UPD -> It is resolved but yeah things are kinda confusing with this template.

Теги atcoder, segment tree, lazy propagation, range query, polynomial queries

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский KnightKnight 2023-05-06 01:02:23 1446
en3 Английский KnightKnight 2023-05-02 08:21:55 87
en2 Английский KnightKnight 2023-05-02 00:54:41 37 Tiny change: 'e. <br> \n[user:https://codeforces.me/profile/yosupo]\n' -> 'e. <br> \n\n' (published)
en1 Английский KnightKnight 2023-05-02 00:50:49 5474 Initial revision (saved to drafts)