HBC205095ASimpleProblemaboutelection题解 (zzzzsgwisacute)

凌晚轩 算法基础篇 46 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
ZZZZSGW is a cute hamster living in a beautiful city named WWW. However, the COVID-19 spread like a wild fire in his city, many people infected. With great grief and motivation, he really wants to do something for his hometown. Therefore he applied for the volunteer of his community to help his neighbors. There are nnn candidates and the voluntary team only needs several volunteers in total. To ensure the quality of the team, they decided to hold an election to pick out the volunteers. Every resident has to nominate exactly mmm candidates and mustn't give more than one nomination to each candidate. . The candidates then will be ranked by the nominations they get in descending order, if there are candidates have the same number of nominations, they will be ranked by their names in lexicographically increasing order. It's evident that the name ZZZZSGW won't take much chance, so when he has the same nominations with others, you can just suppose that he will always be the last!However, as each coin has two sides, the last to make decision also means the one who knows everything ------ since everyone can see the current result when making nominations!

ZZZZSGW is a cute hamster living in a beautiful city named WWW. However, the COVID-19 spread like a wild fire in his city, many people infected. With great grief and motivation, he really wants to do something for his hometown. Therefore he applied for the volunteer of his community to help his neighbors. There are nnn candidates and the voluntary team only needs several volunteers in total. To ensure the quality of the team, they decided to hold an election to pick out the volunteers. Every resident has to nominate exactly mmm candidates and mustn't give more than one nomination to each candidate. (of course one can save one of the nominations for himself/herself). The candidates then will be ranked by the nominations they get in descending order, if there are candidates have the same number of nominations, they will be ranked by their names in lexicographically increasing order. It's evident that the name ZZZZSGW won't take much chance, so when he has the same nominations with others, you can just suppose that he will always be the last! What's worse, the order to nominate is also according to the names, which means that this poor guy will also be the last one to make his decision among the residents! However, as each coin has two sides, the last to make decision also means the one who knows everything ------ since everyone can see the current result when making nominations! Now it's ZZZZSGW's turn, he knows the current result and the final result only depends on his own decision. But he is too nervous to make a clear judgment! Can you help him to get the highest place under this situation?

HBC205095ASimpleProblemaboutelection题解
(zzzzsgwisacute)-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
全网最全C++题库,助您挑战自我,突破极限,成为编程领域的佼佼者!

标签: HBC205095ASimpleProblemaboutelection题解