犀牛國際教育旗下指定官方網(wǎng)站~

課程咨詢熱線 400-656-1680

12月USACO競賽黃金組別真題解析~USACO競賽沖刺班招生中

發(fā)布時間:2024-01-17 15:59:55

編輯:Lily來源:網(wǎng)絡瀏覽:

2023-2024新賽季12月月賽中,USACO競賽黃金組別題目是什么?考察知識點又有哪些?今天我們給大家整理了12月USACO競賽黃金組別考情分析,希望對大家有所幫助。

 

01
 
 
 

12月USACO黃金組別考情分析

 
 
 

 

01
 
P1 Flight Routes
 
 

Bessie recently discovered that her favorite pop artist, Elsie Swift, is performing in her new Eras Tour! Unfortunately, tickets are selling out fast, so Bessie is thinking of flying to another city to attend the concert. The Eras tour is happening in N(2≤N≤750) cities labelled 1…N, and for each pair of cities (i,j) with i<j there either exists a single direct flight from i to j or not.

A flight route from city a to city b (a<b) is a sequence of k≥2 cities a=c1<c2<?<ck=b such that for each 1≤i<k, there is a direct flight from city ci to city ci+1. For every pair of cities (i,j) with i<j, you are given the parity of the number of flight routes between them (0 for even, 1 for odd).

While planning her travel itinerary, Bessie got distracted and now wants to know how many pairs of cities have direct flights between them. It can be shown that the answer is uniquely determined.

 

考情分析

從相鄰位置來考慮比較簡單,如果i到i+1路徑為奇數(shù),說明i到i+1有邊,反之沒有。

考慮任意點i和j的時候,只需要利用區(qū)間dp的思想計算出i到j除了直接到達的路徑有多少條,看一下是否滿足奇偶性即可。

時間復雜度:   O(n^3)

知識點:區(qū)間dp

 
 

 

02
 
P2 inimum Longest Trip
 
 

Bessie is going on a trip in Cowland, which has N (2≤N≤2⋅10^5) towns numbered from 1 to N and M (1≤M≤4⋅10^5) one-way roads. The i-th road runs from town ai to town bi and has label li 

(1≤ai,bi≤N, 1≤li≤10^9).

A trip of length k starting at town x0 is a sequence of towns x0,x1,…,xk, such that there is a road from town xi to town xi+1 for all 0≤i<k. It is guaranteed that there are no trips of infinite length in Cowland, and that no two roads connect the same pair of towns.

For each town, Bessie wants to know the longest possible trip starting at it. For some starting towns, there are multiple longest trips - out of these, she prefers the trip with the lexicographically minimum sequence of road labels. A sequence is lexicographically smaller than another sequence of the same length if, at the first position in which they differ, the first sequence has a smaller element than the second sequence.

Output the length and sum of road labels of Bessie's preferred trip starting at each town.

 

考情分析

首先題目保證給出圖是DAG,那么我們要求最長路的話就可以利用拓撲排序/bfs來解決。

難點在于題目要求字典序最小,考慮如何快速比較兩條出邊的字典序大小

由于題目權(quán)值可以相同暴力走下去比較時間復雜度會被卡到$O(n^2)$

為了優(yōu)化比較過程,我們希望能夠快速得到兩個最長路相同的點他們之間的字典序關(guān)系。

所以我們可以動態(tài)地對最長路相同的點的內(nèi)部做一個排序,比較的時候就只需要拿出之前維護好的排序結(jié)果去做判斷,判斷時間復雜度就可以做到O(1)

總時間復雜度:O(nlogn)

知識點:拓撲排序,字典序

 
 

 

03
 
P3 Haybale Distribution
 
 

Farmer John is distributing haybales across the farm!

Farmer John's farm has N (1≤N≤2⋅10^5) barns, located at integer points x1,…,xN (0≤xi≤10^6) on the number line. Farmer John's plan is to first have N shipments of haybales delivered to some integer point y (0≤y≤10^6) and then distribute one shipment to each barn.

Unfortunately, Farmer John's distribution service is very wasteful. In particular, for some ai and bi

(1≤ai,bi≤10^6), ai haybales are wasted per unit of distance left each shipment is transported, and bi haybales are wasted per unit of distance right each shipment is transported. Formally, for a shipment being transported from point y to a barn at point x, the number of haybales wasted is given by

Given Q (1≤Q≤2⋅10^5) independent queries each consisting of possible values of (ai,bi), please help Farmer John determine the fewest amount of haybales that will be wasted if he chooses y optimally.

 

考情分析

觀察1:查詢的次數(shù)很多,可以考慮預處理,由于不需要頻繁修改區(qū)間,使用前綴和即可。

觀察2:題目保證數(shù)軸x1...xN上存在一個極小值點y,通過等式變形/反證法可以證明y必定為x1...xN中的一點,同時路徑總和f(y)是一個兩邊往中間遞減的單峰函數(shù),可以使用三分法快速逼近y的最優(yōu)值,三分法模板。

時間復雜度: O(Tlogn)

知識點:三分 

 
 

 

02
 
 
 

USACO競賽黃金組別考察內(nèi)容

 
 
 

 

USACO競賽黃金組別考察內(nèi)容包括動態(tài)編程、最短路徑算法、最小生成樹、不相交集、字符串算法、幾何算法、Dijkstra,Prim和Kruskal的算法、二叉索引樹等。

 

USACO競賽黃金組對同學們要求更高,需要參賽者掌握更高級數(shù)據(jù)結(jié)構(gòu)和算法,并能夠在限定時間內(nèi)解決更困難問題。

 

USACO競賽黃金組別晉級分數(shù)線

 

考生在USACO競賽考到滿分,則會自動晉級下一級別的考試,這個時候考生可繼續(xù)下一等級的考試;

 

如果不是滿分,則需要本場月賽結(jié)束后公布晉級線才能確定是晉級下一等級考試,還是繼續(xù)當前等級考試。

 

近三年USACO黃金組別晉級分數(shù)線,一般是在750-800,供大家參考。

 

圖片

 

USACO競賽10年試題精選帶源代碼真題

 

圖片

 

 

USACO競賽10年真題
在線客服領(lǐng)取

 

03
 
 
 

USACO競賽培訓課程

 
 
 

 

USACO競賽培訓開設(shè)班型有USACO基礎(chǔ)班、USACO銅升銀、USACO銀升金、USACO金升鉑金多種班型,滿足不同同學們的需求,助力同學們順利通過USACO各級別比賽。

 

USACO基礎(chǔ)班:計算機編程剛?cè)腴T,語言基礎(chǔ)薄弱,無比賽經(jīng)驗計劃申請計算機專業(yè)學生。

 

USACO銅升銀班:至少會一門計算機編程語言(推薦C++),算法基礎(chǔ)較一般,有一定比賽經(jīng)驗。

 

USACO銀升金班:有完善計算機編程語言基礎(chǔ),有入門算法經(jīng)驗,一定比賽經(jīng)驗,如NOIP,USACO銀組晉級。

 

課程類型:精品小班 / 一對一

授課模式:線上線下同步開課,可回放不斷學習。

授課語言:中英雙語教學 / 純英文授課

 

目前我們已在上海、北京、廣州、深圳、蘇州、杭州、南京、武漢、合肥、青島、成都、無錫、濟南、鄭州等多個城市開設(shè)校區(qū),致力于為準留學生家庭提供全方位升學服務。
 

USACO培訓班
在線客服咨詢

相關(guān)標簽:
TOP