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

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

On yesterday's div3F, i've seen multiple solutions detailing this. 1872F - Продажа зверинца

  1. Let's model it as how much index i get's affected if we sell i right now.
  2. Maintain it in a set.
  3. Always sell the index i that is least affected.

I get that we should always sell an index i that such that for all j, no Aj = i,

However, when there are some Aj = i, why is it optimal to sell the one that get's affected the least?

  1. How can we prove it's optimal
  2. Is it ever possible to sell another thing that is currently afraid of the minimum, thereby decreasing the minimum more, such that the sum of all affected will in fact be less.

Implementation details here. 222332183

Thanks for the help everyone!

Полный текст и комментарии »

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