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

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

Hi everyone!

I am trying to learn DP, and I stumbled across this question on TopCoder. While I have a hunch that it will involve bitmasks, the naive approach, i.e. generating all the sequences, simulating the matches and finding the solution would involve O(n.n!) time. And that's too much for 2 ≤ n ≤ 16.

I have some other unformed ideas, but I wanted to know how do I tackle such problems in general? Thanks!

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

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