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

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

after about 6 months sway USACO, i decided to continue my USACO training page, and i have ben stuck in the problem "camelot" for a full day now!, here is the problem description : https://www.scribd.com/document/124295413/USACO-Training-Pages-Camelot my idea is calculating the minimum moves needed to gather at all the squares, but for the king that is hard, because we dont know when will the king get picked up.

can i have a small hint for this problem?

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

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

The idea here is to calculate knight distances from each square to every other square but adding a flag indicating whether the knight has the king or not. Then the cost of gathering at a certain location is the sum of distances for all knights to this location without the king expect for one knight, which should arrive with the king.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится -16 Проголосовать: не нравится

I Can't believe that you are discussing USACO problems on codeforces! What a traitor!