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

Автор Sahar, 14 лет назад, По-английски


Hi everyone,

I've been stuck on this problem for a week, Can someone please give me some hints/tips?


-Sahar

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

»
14 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится
It looks like a DP on the heights of each of the piles. From that, you can uniquely determine what has to be in your basket (if it's possible to reach the state at all). Then consider all 4 possible moves when computing DP transitions. Complexity will be n^4.