Блог пользователя levi.ackerman1732

Автор levi.ackerman1732, история, 3 года назад, По-английски

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
  • Проголосовать: не нравится

»
3 года назад, # |
Rev. 2   Проголосовать: нравится +19 Проголосовать: не нравится

$$$j+2^{i-1}$$$ $$$(dp[i-1][j+(1$$$<<$$$(i-1))])$$$ can be greater than $$$n$$$.