Not able to figure out where the array is going out of bounds in sparse table implementation of Round Div2 — 736 D

Revision en1, by levi.ackerman1732, 2021-08-03 15:31:47

Question:1549D - Integers Have Friends My Solution:124753951

My implementation: get the absolute values of differences between two neighbouring cells and then implement the sparse table to get the queries faster. Now using sliding window technique find the max length of window.

Context: I have pretty much tried to implement the solution given in the editorial. Any insight is highly helpful. Thanks.

Tags #sparse table, sliding window, #gcd

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English levi.ackerman1732 2021-08-03 15:31:47 525 Initial revision (published)