Блог пользователя vipin_bhardwaj

Автор vipin_bhardwaj, история, 5 лет назад, По-английски

problem: link

Can someone please help me in this problem, i am not getting how to do this. I think may be it is related to some dp problem or may be graphs. Can you please look into it.

UPD: Contest is already over.
UPD2: pdf link
Thank You

UPD3: Answer

Полный текст и комментарии »

  • Проголосовать: нравится
  • +7
  • Проголосовать: не нравится

Автор vipin_bhardwaj, история, 5 лет назад, По-английски

Given a sequence (1, 2, 3, ... N) and an integer k. You need to find all the permutations of the sequence such that for any i in the permutation |a_i — i| != k

problem link

N <= 2000 and k < n

from the given editorial i am not able to understand how to find Mk using DP.
Can someone please help. Thank you

Полный текст и комментарии »

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится