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

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

I was recently solving 1316E - Team Building problem but I couldn't understand why we sorted the audience array. Can anyone help?

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

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

I think it's because that the total number of people is not $$$n$$$.

So choosing audience is done greedily.. just pick the ones with highest $$$a_i$$$.

This way you don't have to add another dimension $$$(the \space number \space of \space audience)$$$ to your $$$dp$$$ state.

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

    Or as the Tutorial says:

    Spoiler