Alma_s's blog

By Alma_s, history, 6 months ago, In English

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

  • Vote: I like it
  • +4
  • Vote: I do not like it

»
6 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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.

  • »
    »
    6 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Or as the Tutorial says:

    Spoiler