

下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、BOI 2002 Tennis 解題摘要中文譯題乒乓球正在組織名為“有趣的一個乒乓球周”的活動,從而吸引新會員加入。他們已經(jīng)邀請了一些乒乓球來演示比賽,來吸引人們。每位已經(jīng)指明了他(她)愿意參加的比賽場數(shù),組織者也希望給個運動員相遇超過一次。們一些樂趣,因此他們想策劃比賽表,使得沒有兩你的任務(wù)是寫一個程序幫助他們把運動員配成對,使得每個運動員參加的比賽場數(shù)恰為他的期望值,并且不與其他任何一名運動員交鋒兩次或己交手。當(dāng)然,沒有人會與他(她)自輸入數(shù)據(jù)輸入文件(tennis.in)的第一行是運動員人數(shù) N(2 = N = 1000),接下來的 N 行是每個運動員期望參加的比賽場數(shù) GI (1 =
2、GI D(C) (D 表示定點的度),正因為如此,一定至少有一個點 Z 滿足 Z 和 B 之間有邊但是與 C 卻沒有邊,這樣,將 A-C 邊改為 C-Z,B-Z 邊改為 A-B 仍然滿足條件,于是也滿足算法的要求,命題得證。最后,分析一下程序的時空復(fù)雜度。時間復(fù)雜度:O(N2logN)主要是排序的時間,若用歸并排序,可以降至 O(N2)。空間復(fù)雜度:O(N2),可以降至O(N)。總結(jié)本題是一道較為簡單的構(gòu)造題(也可以說成是貪心),設(shè)計算法并不是什么難事,只要有縝密的思維,后面的證明也是水到渠成的事情。附錄程序11程序是時間復(fù)雜度為 O(N2logN),空間復(fù)雜度為 O(N2)。程序12221
3、32121英文原題Tennis ClubThe Matchball tennis club isanizing a “gameerestk” to attract new players to the club.As one of the attractions, they have asked some star players to play a few demo games. Each starhas indicated the number of games he or she is willing to play. The have some fun as well, thus th
4、ey want to schedule the games son once with each other.anizers want the stars tot no two players meet moreYour task is to write a program to help them match the playerso pairs sot each playlayshis or her desired number of games and does not play twice or more against any othcourse, no player may pla
5、y against himself or herself.layer. OfInput dataOn theline of the input file tennis.in is the number of players N ( 2 = N = 1000 ) and on thefollowing N lines is the desired number of games to playGI (1 = N ) for each player.GIAmet the players are numbered from 1 to Nhe order of their wisheshe input
6、 file.Output dataOn theline of the output file tennis.out write NO SCHEDULE if it is notsible to create asible.schedule sot the wishes of all players are satisfied, or SCHEDULE if it isIf a schedule exists, write it out on the following N lines. On each line write the indiofopponents for player whose desired number of games was indicated on the corresponding inputline. On each line the indimust be in increasing order and separated by spa. If multiplesolutions exist, output any one of them.ExlesTennis.ennis.outTennis.ennis.out3SCHEDULE3NO SCHEDULE122Gradinghis task, a program
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025-2031年中國花生牛奶行業(yè)發(fā)展前景預(yù)測及投資方向研究報告
- 2025年中國電子材料行業(yè)市場前景預(yù)測及投資戰(zhàn)略研究報告
- 中國特種陶瓷成型蠟項目投資可行性研究報告
- 中國土礦石開采項目投資可行性研究報告
- 2025年中國炸雞調(diào)料行業(yè)市場調(diào)研及未來發(fā)展趨勢預(yù)測報告
- 培訓(xùn)服務(wù)合同
- 儲能電池項目可行性研究報告模板及范文
- 中國電致發(fā)光顯示器行業(yè)發(fā)展前景及投資戰(zhàn)略咨詢報告
- 中國電子垃圾管理解決方案行業(yè)市場前景預(yù)測及投資價值評估分析報告
- 2024年云南省工業(yè)和信息化廳下屬事業(yè)單位真題
- 《相遇問題》課件
- 《預(yù)防脊柱側(cè)彎》課件
- 基礎(chǔ)工程課后題答案-6
- 幼兒園水拓畫制作教程
- 質(zhì)量管理體系之?dāng)?shù)字化轉(zhuǎn)型與智能化升級
- 《電力機車制動機》 課件 項目三 CCB-II制動系統(tǒng)
- 中醫(yī)面診-(重要)
- 《動物飼料配方技術(shù)》課件
- 公司危化品管理的經(jīng)驗分享與成功案例
- 高中生物學(xué)科中差異化教學(xué)模式探討
- 清理樹木施工方案
評論
0/150
提交評論