agaurav77's blog

By agaurav77, history, 11 years ago, In English

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!

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it