levi.ackerman1732's blog

By levi.ackerman1732, history, 2 months ago,

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.

• +20

 » 2 months ago, # | ← Rev. 2 →   +19 $j+2^{i-1}$ $(dp[i-1][j+(1$<<$(i-1))])$ can be greater than $n$.
•  » » 2 months ago, # ^ |   0 Thanks a lot buddy.