0Ptimized's blog

By 0Ptimized, history, 23 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

| Write comment?
»
23 months ago, hide # |
 
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.

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

    Or as the Tutorial says:

    Spoiler