一、UVaOJ http://uva.onlinejudge.org
西班牙Valladolid大學的程序在線評測系統,是歷史最悠久、最著名的OJ。
二、《算法競賽入門經典》 劉汝佳 (UVaOJ 351道題)
以下部分內容摘自:http://sdkdacm.5d6d.com/thread-6-1-1.html
“AOAPC I”是劉汝佳(大名鼎鼎的SRbGa)寫的《算法競賽入門經典》,在書中每章最後一節都推薦了一些UVaOJ上的題目作爲課後練習題。《算法競賽入門經典》全書內容分爲三部分:語言篇、算法篇和競賽篇。本書的特點是以講解例子爲主、引入相關知識,適合於培養自學能力、鍛鍊腦力、擴展知識面、訓練編程技巧,競賽訓練的針對性非常強,包括附錄都是爲了輔助訓練準備的,是一本非常優秀的編程競賽入門基礎書。但本書不是一個完整詳細講解語言、數據結構和算法知識的教材或者手冊。雖然書中自稱適合零基礎的初學者,但顯然是理解能力非常強的一小部分初學者,大多數初學者在使用本書練習編程的時候,還是需要一本C語言教材、數據結構和算法教材。
第1部分語言篇(前4章)簡要介紹了C語言的知識,有針對性的講解了C語言在程序設計競賽中常見的應用,這些是一般C語言書中不涉及的,對競賽入門是大有幫助。雖然這一部分從內容設計上看是針對零編程基礎的讀者,但是作爲C語言入門顯然是不足夠的、並且跨度較大。
學完後除了完成書上的練習題外,還應該可以解決UVA中: Volume 0. Getting Started 12道題。
第2部分算法篇(5~8章),從簡單的編程題目開始,引入數據結構和算法的基礎知識。並且介紹瞭如何在Online Judge系統(OJ)上做題,進而引導讀者開始編程訓練,進入程序設計競賽的領域。
第5章,基礎題目, Volume 1. Elementary Problem Solving 57道題。
第6章,基礎數據結構, Volume 2. Data Structures 32道題。
第7章,暴力, Volume 3. Brute Force 68道題。
第8章,算法設計, Volume 4. Algorithm Design 34道題。
第3部分競賽篇(9~11章),在第2部分的基礎上,介紹了一些競賽常用的基礎知識和思路,進一步練習編程能力,培養求解問題的建模能力。
第9章,動態規劃, Volume 5. Dynamic Programming 60道題。
第10章,數學方法,Volume 6. Mathematical Concepts and Methods 62道題。
第11章,圖論模型,Volume 7. Graph Algorithms and Implementation Techniques 26道題。
三、《挑戰編程》 Programming challenge (UVaOJ 112道題目)
作者:(美國)斯基納 (Sterven S.Skiena) 譯者:劉汝佳
Steven S.Skiena是美國Stony Brook大學計算機教授,研究方向包括圖、串和幾何算法的設計和應用(尤其是生物方面)。他曾獲ONR青年研究員獎和IEEE計算機科學與工程本科教學獎,並著有四本書籍,包括“The Algorithm Design Manual”和“Calculated Bets:Computers,Gambling,andMathematical Modeling to Win”。
譯者序:本書的目標讀者便是那些已經具備初步的編程技能,對程序設計競賽充滿好奇,希望有機會武裝自己、接受編程挑戰的人,以及他們的老師和教練(甚至父母)。即使不參加任何競賽,從本書的編程挑戰中學到的東西,也會對程序員的職業生涯產生重要影響,更不用說這些挑戰本身就是充滿樂趣、引人入勝的。
第一章:入門
1.1 PC/UVa 題號: 110101/100 The 3n+1 problem (3n+1 問題)
1.2 PC/UVa 題號: 110102/10189 Minesweeper (掃雷)
1.3 PC/UVa 題號: 110103/10137 The Trip (旅行)
1.4 PC/UVa 題號: 110104/706 LC-Display (液晶顯示屏)
1.5 PC/UVa 題號: 110105/10267 Graphical Editor (圖形化編輯器)
1.6 PC/UVa 題號: 110106/10033 Interpreter (解釋器)
1.7 PC/UVa 題號: 110107/10196 Check the Check (將軍)
1.8 PC/UVa 題號: 110108/10142 Australian Voting (澳大利亞投票)
第二章:數據結構
2.1 PC/UVa 題號: 110201/10038 Jolly Jumpers (快樂的跳躍者)
2.2 PC/UVa 題號: 110202/10315 Poker Hands (撲克牌型)
2.3 PC/UVa 題號: 110203/10050 Hartals (罷工)
2.4 PC/UVa 題號: 110204/843 Crypt Kicker (解密)
2.5 PC/UVa 題號: 110205/10205 Stack ’em Up (完美洗牌術)
2.6 PC/UVa 題號: 110206/10044 Erdos Numbers (Erdos 數)
2.7 PC/UVa 題號: 110207/10258 Contest Scoreboard (比賽計分板)
2.8 PC/UVa 題號: 110208/10149 Yahtzee (Yahtzee 遊戲)
第三章:字符串
3.1 PC/UVa 題號: 110301/10082 WERTYU (WERTYU 鍵盤)
3.2 PC/UVa 題號: 110302/10010 Where’s Waldorf?(尋找單詞)
3.3 PC/UVa 題號: 110303/10252 Common Permutation (公共排列)
3.4 PC/UVa 題號: 110304/850 Crypt Kicker II (解密 II)
3.5 PC/UVa 題號: 110305/10188 Automated Judge Script (自動評測腳本)
3.6 PC/UVa 題號: 110306/10132 File Fragmentation (文件碎片)
3.7 PC/UVa 題號: 110307/10150 Doublets (Doublets 序列)
3.8 PC/UVa 題號: 110308/848 Fmt (Fmt 程序)
第四章:排序
4.1 PC/UVa 題號: 110401/10041 Vito’s Family (Vito 家族)
4.2 PC/UVa 題號: 110402/120 Stacks of Flapjacks (煎餅堆)
4.3 PC/UVa 題號: 110403/10037 Bridge (過橋)
4.4 PC/UVa 題號: 110404/10191 Longest Nap (最長打盹時間)
4.5 PC/UVa 題號: 110405/10026 Shoemaker’s Problem (鞋匠的煩惱)
4.6 PC/UVa 題號: 110406/10138 CDVII (CDVII 高速公路)
4.7 PC/UVa 題號: 110407/10152 ShellSort (龜殼排序)
4.8 PC/UVa 題號: 110408/10194 Football (aka Soccer) (足球)
第五章:算術與代數
5.1 PC/UVa 題號: 110501/10035 Primary Arithmetic (小學生算術)
5.2 PC/UVa 題號: 110502/10018 Reverse and Add (反轉相加)
5.3 PC/UVa 題號: 110503/701 The Archeologist’s Dilemma (考古學家的煩惱)
5.4 PC/UVa 題號: 110504/10127 Ones (僅由 1 組成的數)
5.5 PC/UVa 題號: 110505/847 A Multiplication Game (乘法遊戲)
5.6 PC/UVa 題號: 110506/10105 Polynomial Coefficients (多項式係數)
5.7 PC/UVa 題號: 110507/10077 The Stern-Brocot Number System (Stern-Brocot 代數系統)
5.8 PC/UVa 題號: 110508/10202 Pairsumonious Numbers (兩兩之和)
第六章:組合數學
6.1 PC/UVa 題號: 110601/10183 How Many Fibs? (斐波那契計數)
6.2 PC/UVa 題號: 110602/10213 How Many Pieces of Land? (土地分割)
6.3 PC/UVa 題號: 110603/10198 Counting (數數)
6.4 PC/UVa 題號: 110604/10157 Expressions (括號表達式)
6.5 PC/UVa 題號: 110605/10247 Complete Tree Labeling (完全樹標號)
6.6 PC/UVa 題號: 110606/10254 The Priest Mathematician (牧師數學家)
6.7 PC/UVa 題號: 110607/10049 Self-describing Sequence (自描述序列)
6.8 PC/UVa 題號: 110608/846 Steps (數軸行走)
第七章:數論
7.1 PC/UVa 題號: 110701/10110 Light, More Light (開燈與關燈)
7.2 PC/UVa 題號: 110702/10006 Carmichael Numbers (Carmichael 數)
7.3 PC/UVa 題號: 110703/10104 Euclid Problem (歐幾里德問題)
7.4 PC/UVa 題號: 110704/10139 Factovisors (階乘與整除)
7.5 PC/UVa 題號: 110705/10168 Summation of Four Primes (四素數之和)
7.6 PC/UVa 題號: 110706/10042 Smith Numbers (Smith 數)
7.7 PC/UVa 題號: 110707/10090 Marbles (彈珠)
7.8 PC/UVa 題號: 110708/10089 Repackaging (重新打包)
1 Chapter1-Getting started(入門) 21道題
1.1 Section 1.0
1.2 Section 1.1
1.3 Section 1.2
1.4 Section 1.3
1.5 Section 1.4
1.6 Section 1.5
2 Chapter2-Bigger Challenges(更大的挑戰) 19道題
2.1 Section 2.1
2.2 Section 2.2
2.3 Section 2.3
2.4 Section 2.4
3 Chapter3-Techniques
more subtle(更微妙的技術) 21道題
3.1 Section 3.1
3.2 Section 3.2
3.3 Section 3.3
3.4 Section 3.4
4
Chapter4-Advanced algorithms and difficult drills(高級算法與困難的習題) 15道題
4.1 Section 4.1
4.2 Section 4.2
4.3 Section 4.3
4.4 Section 4.4
5 Chapter5-Serious challenges(嚴峻的挑戰) 18道題
5.1 Section 5.1
5.2 Section 5.2
5.3 Section 5.3
5.4 Section 5.4
5.5 Section 5.5
6 Chapter6-Contest Practice(大賽的實踐) 3道題
6.1 Section 6.1
第八章:回溯法
8.1 PC/UVa 題號: 110801/861 Little Bishops (棋盤上的象)
8.2 PC/UVa 題號: 110802/10181 15-Puzzle Problem (15 數碼遊戲)
8.3 PC/UVa 題號: 110803/10128 Queue (隊伍)
8.4 PC/UVa 題號: 110804/10160 Servicing Stations (服務站)
8.5 PC/UVa 題號: 110805/10032 Tug of War (拔河)
8.6 PC/UVa 題號: 110806/10001 Garden of Eden (伊甸園)
8.7 PC/UVa 題號: 110807/704 Colour Hash (色彩繽紛遊戲)
8.8 PC/UVa 題號: 110808/10270 Bigger Square Please... (拼接正方形)
第九章:圖遍歷
9.1 PC/UVa 題號: 110901/10004 Bicoloring (雙着色)
9.2 PC/UVa 題號: 110902/10067 Playing With Wheels (擺弄輪子)
9.3 PC/UVa 題號: 110903/10099 The Tourist Guide (導遊)
9.4 PC/UVa 題號: 110904/705 Slash Maze (斜線迷宮)
9.5 PC/UVa 題號: 110905/10029 Edit Step Ladders (遞變階梯)
9.6 PC/UVa 題號: 110906/10051 Tower of Cubes (立方體之塔)
9.7 PC/UVa 題號: 110907/10187 From Dusk till Dawn (從黃昏到拂曉)
9.8 PC/UVa 題號: 110908/10276 Hanoi Tower Troubles Again! (漢諾塔捲土重來!)
第十章:圖算法
10.1 PC/UVa 題號: 111001/10034 Freckles (斑點)
10.2 PC/UVa 題號: 111002/10054 The Necklace (項鍊)
10.3 PC/UVa 題號: 111003/10278 Fire Station (消防站)
10.4 PC/UVa 題號: 111004/10039 Railroads (鐵路)
10.5 PC/UVa 題號: 111005/10158 War (戰爭)
10.6 PC/UVa 題號: 111006/10199 Tourist Guide (導遊)
10.7 PC/UVa 題號: 111007/10249 The Grand Dinner (豐盛的晚餐)
10.8 PC/UVa 題號: 111008/10092 The Problem With the Problem Setter (命題者的難題)
第十一章:動態規劃
11.1 PC/UVa 題號: 111101/10131 Is Bigger Smarter? (越大越聰明?)
11.2 PC/UVa 題號: 111102/10069 Distinct Subsequences (不同的子序列)
11.3 PC/UVa 題號: 111103/10154 Weights and Measures (重量和力量)
11.4 PC/UVa 題號: 111104/116 Unidirectional TSP (單向旅行商問題)
11.5 PC/UVa 題號: 111105/10003 Cutting Sticks (切割木棍)
11.6 PC/UVa 題號: 111106/10261 Ferry Loading (渡船裝載)
11.7 PC/UVa 題號: 111107/10271 Chopsticks (筷子)
11.8 PC/UVa 題號: 111108/10201 Adventures in Moving: Part IV (搬家大冒險:第四部)
第十二章:網格
12.1 PC/UVa 題號: 111201/10161 Ant on a Chessboard (棋盤上的螞蟻)
12.2 PC/UVa 題號: 111202/10047 The Monocycle(獨輪車)
12.3 PC/UVa 題號: 111203/10159 Star (六角星)
12.4 PC/UVa 題號: 111204/10182 Bee Maja (蜜蜂 Maja)
12.5 PC/UVa 題號: 111205/707 Robbery (搶劫)
12.6 PC/UVa 題號: 111206/10177 (2/3/4)-D Sqr/Rects/Cubes/Boxes? (2/3/4-維立方體?)
12.7 PC/UVa 題號: 111207/10233 Dermuba Triangle (Dermuba 三角)
12.8 PC/UVa 題號: 111208/10075 Airlines (航線)
第十三章:幾何
13.1 PC/UVa 題號: 111301/10310 Dog and Gopher (狗拿地鼠)
13.2 PC/UVa 題號: 111302/10180 Rope Crisis in Ropeland! (繩子王國的危機!)
13.3 PC/UVa 題號: 111303/10195 The Knights of the Round Table (圓桌騎士)
13.4 PC/UVa 題號: 111304/10136 Chocolate Chip Cookies (巧克力片餅乾)
13.5 PC/UVa 題號: 111305/10167 Birthday Cake (生日蛋糕)
13.6 PC/UVa 題號: 111306/10215 The Largest/Smallest Box... (最大/最小的盒子)
13.7 PC/UVa 題號: 111307/10209 Is This Integration? (需要積分嗎?)
13.8 PC/UVa 題號: 111308/10012 How Big Is It? (它有多大?)
第十四章:計算幾何
14.1 PC/UVa 題號: 111401/10135 Herding Frosh (新生集會)
14.2 PC/UVa 題號: 111402/10245 The Closest Pair Problem (最近點對問題)
14.3 PC/UVa 題號: 111403/10043 Chainsaw Massacre (電鋸驚魂)
14.4 PC/UVa 題號: 111404/10084 Hotter Colder (冷熱遊戲)
14.5 PC/UVa 題號: 111405/10065 Useless Tile Packers (沒用的瓷磚打包公司)
14.6 PC/UVa 題號: 111406/849 Radar Tracking (雷達追蹤)
14.7 PC/UVa 題號: 111402/10088 Trees on My Island (島上的樹)
14.8 PC/UVa 題號: 111408/10117 Nice Milk (美味的牛奶)