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

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.
由于每種數(shù)有很多個,一個個插入時間復(fù)雜度會過大,考慮將每種數(shù)作為一個整體插入。在當(dāng)前這種數(shù)插入在另一種數(shù)的上方的時候,要么另一種數(shù)完全覆蓋,要么當(dāng)前這種數(shù)被用完,所以每種數(shù)最多被考慮一次。
USACO歷年真題及參考書,掃碼領(lǐng)取!【翰林提供報(bào)名指導(dǎo)服務(wù)】
USACO歷年真題及參考書

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

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