發(fā)布時(shí)間:2024-01-17 15:59:55
編輯:Lily來源:網(wǎng)絡(luò)瀏覽:次
2023-2024新賽季12月月賽中,USACO競(jìng)賽黃金組別題目是什么?考察知識(shí)點(diǎn)又有哪些?今天我們給大家整理了12月USACO競(jìng)賽黃金組別考情分析,希望對(duì)大家有所幫助。
12月USACO黃金組別考情分析
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.
考情分析
從相鄰位置來考慮比較簡(jiǎn)單,如果i到i+1路徑為奇數(shù),說明i到i+1有邊,反之沒有。
考慮任意點(diǎn)i和j的時(shí)候,只需要利用區(qū)間dp的思想計(jì)算出i到j(luò)除了直接到達(dá)的路徑有多少條,看一下是否滿足奇偶性即可。
時(shí)間復(fù)雜度: O(n^3)
知識(shí)點(diǎn):區(qū)間dp
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,那么我們要求最長(zhǎng)路的話就可以利用拓?fù)渑判?bfs來解決。
難點(diǎn)在于題目要求字典序最小,考慮如何快速比較兩條出邊的字典序大小
由于題目權(quán)值可以相同暴力走下去比較時(shí)間復(fù)雜度會(huì)被卡到$O(n^2)$
為了優(yōu)化比較過程,我們希望能夠快速得到兩個(gè)最長(zhǎng)路相同的點(diǎn)他們之間的字典序關(guān)系。
所以我們可以動(dòng)態(tài)地對(duì)最長(zhǎng)路相同的點(diǎn)的內(nèi)部做一個(gè)排序,比較的時(shí)候就只需要拿出之前維護(hù)好的排序結(jié)果去做判斷,判斷時(shí)間復(fù)雜度就可以做到O(1)
總時(shí)間復(fù)雜度:O(nlogn)
知識(shí)點(diǎn):拓?fù)渑判颍值湫?/span>
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ù)很多,可以考慮預(yù)處理,由于不需要頻繁修改區(qū)間,使用前綴和即可。
觀察2:題目保證數(shù)軸x1...xN上存在一個(gè)極小值點(diǎn)y,通過等式變形/反證法可以證明y必定為x1...xN中的一點(diǎn),同時(shí)路徑總和f(y)是一個(gè)兩邊往中間遞減的單峰函數(shù),可以使用三分法快速逼近y的最優(yōu)值,三分法模板。
時(shí)間復(fù)雜度: O(Tlogn)
知識(shí)點(diǎn):三分
USACO競(jìng)賽黃金組別考察內(nèi)容
USACO競(jìng)賽黃金組別考察內(nèi)容包括動(dòng)態(tài)編程、最短路徑算法、最小生成樹、不相交集、字符串算法、幾何算法、Dijkstra,Prim和Kruskal的算法、二叉索引樹等。
USACO競(jìng)賽黃金組對(duì)同學(xué)們要求更高,需要參賽者掌握更高級(jí)數(shù)據(jù)結(jié)構(gòu)和算法,并能夠在限定時(shí)間內(nèi)解決更困難問題。
USACO競(jìng)賽黃金組別晉級(jí)分?jǐn)?shù)線
考生在USACO競(jìng)賽考到滿分,則會(huì)自動(dòng)晉級(jí)下一級(jí)別的考試,這個(gè)時(shí)候考生可繼續(xù)下一等級(jí)的考試;
如果不是滿分,則需要本場(chǎng)月賽結(jié)束后公布晉級(jí)線才能確定是晉級(jí)下一等級(jí)考試,還是繼續(xù)當(dāng)前等級(jí)考試。
近三年USACO黃金組別晉級(jí)分?jǐn)?shù)線,一般是在750-800,供大家參考。
USACO競(jìng)賽10年試題精選帶源代碼真題
USACO競(jìng)賽10年真題
在線客服領(lǐng)取
USACO競(jìng)賽培訓(xùn)課程
USACO競(jìng)賽培訓(xùn)開設(shè)班型有USACO基礎(chǔ)班、USACO銅升銀、USACO銀升金、USACO金升鉑金多種班型,滿足不同同學(xué)們的需求,助力同學(xué)們順利通過USACO各級(jí)別比賽。
USACO基礎(chǔ)班:計(jì)算機(jī)編程剛?cè)腴T,語言基礎(chǔ)薄弱,無比賽經(jīng)驗(yàn)計(jì)劃申請(qǐng)計(jì)算機(jī)專業(yè)學(xué)生。
USACO銅升銀班:至少會(huì)一門計(jì)算機(jī)編程語言(推薦C++),算法基礎(chǔ)較一般,有一定比賽經(jīng)驗(yàn)。
USACO銀升金班:有完善計(jì)算機(jī)編程語言基礎(chǔ),有入門算法經(jīng)驗(yàn),一定比賽經(jīng)驗(yàn),如NOIP,USACO銀組晉級(jí)。
課程類型:精品小班 / 一對(duì)一
授課模式:線上線下同步開課,可回放不斷學(xué)習(xí)。
授課語言:中英雙語教學(xué) / 純英文授課
目前我們已在上海、北京、廣州、深圳、蘇州、杭州、南京、武漢、合肥、青島、成都、無錫、濟(jì)南、鄭州等多個(gè)城市開設(shè)校區(qū),致力于為準(zhǔn)留學(xué)生家庭提供全方位升學(xué)服務(wù)。
USACO培訓(xùn)班
在線客服咨詢
微信咨詢
支付二維碼