Help Needed in Voting (Codeforces Problem)

Revision en1, by code_warrior, 2020-09-24 19:31:11

Hello everybody! Recently i was solving the problem Voting (Hard Version) on codeforces. But, after reading the problem I had a doubt-:

Can a voter vote if the number of other voters already voted is greater than mi or is it necessary to have exactly mi voters for this voter to get convinced for voting.

For example — If we have the mi array as [1,1,2,3,4,4,4,5,5] and the price array as [1,2,2,2,2,2,2,2,2]. Then how will the voting take place in an optimal way. Can it take place like (1)->(1,1)->(1,1,2)->(1,1,2,3)->(1,1,2,3,4,4,4)->(1,1,2,3,4,4,4,5,5) wiht a net cost of 1?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English code_warrior 2020-09-24 19:31:11 682 Initial revision (published)