2023-2024賽季的USACO考試已于12月18日正式結(jié)束,晉級(jí)賽的最新試題也已經(jīng)公布。近日,USACO官方公布了2023-2024賽季首場(chǎng)月賽的晉級(jí)分?jǐn)?shù)線。如果沒有晉級(jí),12月可以當(dāng)做一個(gè)練手+熟悉賽制的環(huán)節(jié),1、2月的月賽持續(xù)發(fā)力,USACO可以重復(fù)挑戰(zhàn)。
今天給大家分享白金級(jí)試題和解析,參賽的同學(xué)來(lái)看看解題思路,沒參賽的同學(xué)來(lái)看看難度如何?
USACO 2023年12月白金級(jí)第二題
To improve her mathematical knowledge, Bessie has been taking a graph theory course and finds herself stumped by the following problem. Please help her!
You are given a connected, undirected graph with vertices labeled 1…N and edges labeled 1…M(2≤N≤2?105, N?1≤M≤4?105). For each vertex v in the graph, the following process is conducted:?
Let S={v}and h=0.
While |S|<N,?
1.Out of all edges with exactly one endpoint in S, let e be the edge with the minimum label.
2.Add the endpoint of e not in S to S.
3.Set h=10h+e.
?
Return h ( mod 109+7).
?
Determine all the return values of this process.?
INPUT FORMAT (pipe stdin):
The first line contains N and M .?Then follow M lines, the eth containing the endpoints (ae,be) of the eth edge (1≤ae<be≤N). It is guaranteed that these edges form a connected graph, and at most one edge connects each pair of vertices.
?
OUTPUT FORMAT (pipe stdout):
Output N lines, where the ith line should contain the return value of the process starting at vertex i.
SAMPLE INPUT:
3 2
1 2
2 3
SAMPLE OUTPUT:
12
12
21
SAMPLE INPUT:
5 6
1 2
3 4
2 4
2 3
2 5
1 5
SAMPLE OUTPUT:
1325
1325
2315
2315
5132
Consider starting at i=3. First, we choose edge 2, after which S={3,4} and h=2.Second, we choose edge 3, after which S={2,3,4}and h=23. Third, we choose edge 1, after which S={1,2,3,4} and h=231. Finally, we choose edge 5, after which S={1,2,3,4,5}and h=2315. The answer for i=3 is therefore 2315.
SAMPLE INPUT:
15 14
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
SAMPLE OUTPUT:
678925929
678925929
678862929
678787329
678709839
678632097
178554320
218476543
321398766
431520989
542453212
653475435
764507558
875540761
986574081
Make sure to output the answers modulo 109+7.
SCORING:
Input 4: N,M≤2000
Inputs 5-6: N≤2000
Inputs 7-10: N≤10000
Inputs 11-14: ae+1=be
for all e
Inputs 15-23: No additional constraints.
Problem credits: Benjamin Qi
部分代碼截圖:

USACO歷年真題及參考書,掃碼領(lǐng)取!【翰林提供報(bào)名指導(dǎo)服務(wù)】
USACO歷年真題及參考書

2023-2024年USACO活動(dòng)時(shí)間
第一次月賽:2023年12月15日-18日
第二次月賽:2024年1月26日-29日
第三次月賽:2024年2月16日-19日
美國(guó)公開賽:2024年3月15日-18日
(中國(guó)學(xué)生只能參加到公開賽)
集訓(xùn)營(yíng):2024年5月23日-6月1日
EGOI:2024年7月21日-27日(荷蘭)
IOI:2024年9月1日-8日(埃及)
報(bào)名方式:參賽者可隨時(shí)在官網(wǎng)注冊(cè)賬號(hào),注冊(cè)。報(bào)名,只需在活動(dòng)時(shí)間登陸完成答題即可。
官網(wǎng)地址:usaco.org
提交之后,官網(wǎng)會(huì)發(fā)送一份郵件到您郵箱,郵件中有賬號(hào)密碼
利用已知的賬號(hào)于密碼,登錄USACO賬號(hào),即可開始考試
以上就是關(guān)于【2023-2024年USACO首次月考題目出爐!白金級(jí)第二題真題及解析】的解答,如需了解學(xué)校/賽事/課程動(dòng)態(tài),可至翰林教育官網(wǎng)獲取更多信息。
往期文章閱讀推薦:
【組隊(duì)招募】經(jīng)濟(jì)/數(shù)模競(jìng)賽CNEC/IEO/SIC/HiMCM…組隊(duì)報(bào)名!
NOAI人工智能奧賽 2026-2027 活動(dòng)章程出爐:新規(guī)則必看!

? 2026. All Rights Reserved. 滬ICP備2023009024號(hào)-1