2023-2024賽季UASCO首場月賽已經圓滿結束,晉級賽的最新試題也已經公布。沒能當場晉級的同學們可以耐心等待一周,一周內USACO官方將會公布本次晉級賽成績。如果沒有晉級,12月可以當做一個練手+熟悉賽制的環節,1、2月的月賽持續發力,USACO可以重復挑戰。
今天給大家分享銀級試題和解析,參賽的同學來看看解題思路,沒參賽的同學來看看難度如何?
銀組第一題

It is guaranteed that all wi are distinct.
OUTPUT FORMAT (pipe stdout):
Output the maximum number of cows in balanced towers if FJ helps the cows form towers optimally.
SAMPLE INPUT:
3 5 2
9 4
7 6
5 5
SAMPLE OUTPUT:
14
FJ can create four balanced towers with cows of weights 5,7 and 9, and one balanced tower with cows of weights 5 and 7.
SAMPLE INPUT:
3 5 3
5 5
7 6
9 4
SAMPLE OUTPUT:
9
FJ can create four balanced towers with cows of weights 5 and 9,
and one balanced tower with a cow of weight 7. Alternatively, he can create four balanced towers with cows of weights 5 and 9, and one balanced tower with a cow of weight 5.
SCORING:
In inputs 3-5, M <= 5000 and the total number of cows does not exceed 5000.
In inputs 6-11, the total number of cows does not exceed 2*10**5
Inputs 12-17 have no additional constraints.
由于每種數有很多個,一個個插入時間復雜度會過大,考慮將每種數作為一個整體插入。在當前這種數插入在另一種數的上方的時候,要么另一種數完全覆蓋,要么當前這種數被用完,所以每種數最多被考慮一次。
USACO歷年真題及參考書,掃碼領取!【翰林提供報名指導服務】
USACO歷年真題及參考書

2023-2024年USACO活動時間
第一次月賽:2023年12月15日-18日
第二次月賽:2024年1月26日-29日
第三次月賽:2024年2月16日-19日
美國公開賽:2024年3月15日-18日
(中國學生只能參加到公開賽)
集訓營:2024年5月23日-6月1日
EGOI:2024年7月21日-27日(荷蘭)
IOI:2024年9月1日-8日(埃及)
報名方式:參賽者可隨時在官網注冊賬號,注冊。報名,只需在活動時間登陸完成答題即可。
官網地址:usaco.org
提交之后,官網會發送一份郵件到您郵箱,郵件中有賬號密碼
利用已知的賬號于密碼,登錄USACO賬號,即可開始考試

? 2025. All Rights Reserved. 滬ICP備2023009024號-1