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

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

I am trying to solve this problem. There is a tutorial but for me its not so clear. You can see that I am green. For me the state is [numberOfProgrammer][numberOfLine][maxBug] which is 500*500*500. The tutorial has a solution with state 2*500*500. It is very hard for me to understand the state elimination. Someone please explain the solution so that I(as a green) can understand.

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

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

This is because in dp transitions only previous state of one programmer less is needed, so this accounts for only 2 instead of 500, otherwise you'll have memory limit verdict.

only two is needed as mentioned.