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

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

http://www.spoj.com/problems/MUSKET/ hello everyone,there is a nice problem from polish olympiad,i have tried to solve it but ... can someone explain how solve it? or if have some ideas share it each other. sorry for my bad english.

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

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

To solve this problem you have to use dynamic programming to answer the question if ith and jth musketeer can be the last two fighters in the tournament. Then you just check which one wins this kind of duel and add the winner to the output. You can also have some fun simulating the tournament for x times, this kind of solution was given around 70% of points on the POI. If you have some more doubts, ask.