上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 19 下一页

2013年3月25日

UVa1344 - Tian Ji -- The Horse Racing

摘要: Here is a famous story in Chinese history.That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others.Both of Tian and the king have three horses in different classes, namely, regular, plus, and super. The rule is to ha 阅读全文

posted @ 2013-03-25 10:51 仗剑奔走天涯 阅读(238) 评论(0) 推荐(0) 编辑

UVa1450 - Airport

摘要: A big city has an international airport handling 40 million passengers a year. But this is notorious as one of the most congested airports in the world. In this airport, there is only one landing strip as in the above figure. Therefore the landing strip is always crowded with a lot of aircrafts wait 阅读全文

posted @ 2013-03-25 01:46 仗剑奔走天涯 阅读(297) 评论(0) 推荐(0) 编辑

2013年3月24日

UVa11627 - Slalom

摘要: Problem E: SlalomYou are competing in a ski slalom, and you need to select the best skis for the race. The format of the race is that there areNpairs of left and right gates, where each right gate isWmetres to the right of its corresponding left gate, and you may neither pass to t... 阅读全文

posted @ 2013-03-24 22:51 仗剑奔走天涯 阅读(637) 评论(1) 推荐(0) 编辑

2013年3月22日

UVa12097 - Pie

摘要: Problem C - PieTime limit: 1 secondMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a numberNof them, of various tastes and of various sizes.Fof my friends are coming to my party and each of them gets a piece of pie. This should be one piece of one pie, no 阅读全文

posted @ 2013-03-22 20:57 仗剑奔走天涯 阅读(275) 评论(0) 推荐(0) 编辑

UVa12124 - Assemble

摘要: Problem A - Assemble Time limit: 2 secondsRecently your team noticed that the computer you use to practice for programming contests is not good enough anymore. Therefore, you decide to buy a new computer.To make the ideal computer for your needs... 阅读全文

posted @ 2013-03-22 18:44 仗剑奔走天涯 阅读(274) 评论(0) 推荐(0) 编辑

2013年3月21日

UVa11384 - Help is needed for Dexter

摘要: Problem HHelp is needed for DexterTime Limit: 3 SecondDexter is tired of Dee Dee. So he decided to keep Dee Dee busy in a game. The game he planned for her is quite easy to play but not easy to win at least not for Dee Dee. But Dexter does not have time to spend on this silly task, so he wants your 阅读全文

posted @ 2013-03-21 23:24 仗剑奔走天涯 阅读(179) 评论(0) 推荐(0) 编辑

UVa1346 - Songs

摘要: John Doe is a famous DJ and, therefore, has the problem of optimizing the placement of songs on his tapes. For a given tape and for each song on that tape John knows the length of the song and the frequency of playing that song. His problem is to record the songs on the tape in an order that minimiz 阅读全文

posted @ 2013-03-21 17:08 仗剑奔走天涯 阅读(299) 评论(0) 推荐(0) 编辑

UVa11464 - Even Parity

摘要: DEven ParityInput:Standard InputOutput:Standard OutputWe have a grid of sizeNxN. Each cell of the grid initially contains a zero(0) or a one(1).Theparityof a cell is the number of 1s surrounding that cell. A cell is surrounded by at most 4 cells (top, bottom, left, right).Suppose we have a grid of s 阅读全文

posted @ 2013-03-21 15:41 仗剑奔走天涯 阅读(269) 评论(0) 推荐(0) 编辑

《算法竞赛入门经典训练指南》第一章例题及习题列表

摘要: 从书籍主页搬运过来的,这样的话查看题目更方便。对与已经AC的题目我用红色字体进行了标记。问题求解策略 (General Problem Solving Techniques)例题 (Examples)例题 1UVa11292The Dragon of Loowater排序后用贪心法例题 2UVa11729Commando War用贪心法求最优排列;用“相邻交换法”证明正确性例题 3UVa11300Spreading The Wealth用代数法进行数学推导;中位数例题 4LA3708Graveyard推理;参考系例题 5UVa10881Piotr's Ants等效变换;排序例题 6LA 阅读全文

posted @ 2013-03-21 02:36 仗剑奔走天涯 阅读(789) 评论(0) 推荐(0) 编辑

UVA10881 - Piotr's Ants

摘要: Problem DPiotr's AntsTime Limit: 2 seconds"One thing is for certain: there is no stopping them;the ants will soon be here. And I, for one, welcome ournew insect overlords."Kent BrockmanPiotr likes playing with ants. He hasnof them on a horizontal poleLcm long. Each ant is facing either 阅读全文

posted @ 2013-03-21 02:19 仗剑奔走天涯 阅读(193) 评论(0) 推荐(0) 编辑

UVA10012 - How Big Is It?

摘要: How Big Is It?Ian's going to California, and he has to pack his things, including his collection of circles. Given a set of circles, your program must find the smallest rectangular box in which they fit. All circles must touch the bottom of the box. The figure below shows an acceptable packing f 阅读全文

posted @ 2013-03-21 01:55 仗剑奔走天涯 阅读(200) 评论(0) 推荐(0) 编辑

2013年3月20日

USACO4.1.1--Beef McNuggets

摘要: Beef McNuggetsHubert ChenFarmer Brown's cows are up in arms, having heard that McDonalds is considering the introduction of a new product: Beef McNuggets. The cows are trying to find any possible way to put such a product in a negative light.One strategy the cows are pursuing is that of `inferio 阅读全文

posted @ 2013-03-20 01:37 仗剑奔走天涯 阅读(246) 评论(0) 推荐(0) 编辑

2013年3月18日

USACO3.4.1--Closed Fences

摘要: Closed FencesA closed fence in the plane is a set of non-crossing, connected line segments with N corners (3 < N < 200). The corners or vertices are each distinct and are listed in counter-clockwise order in an array {xi, yi}, i in (1..N).Every pair of adjacent vertices defines a side of the f 阅读全文

posted @ 2013-03-18 22:32 仗剑奔走天涯 阅读(278) 评论(0) 推荐(0) 编辑

2013年3月16日

SGU107 - 987654321 problem

摘要: 107. 987654321 problemtime limit per test: 0.5 sec.memory limit per test: 4096 KBFor given number N you must output amount of N-digit numbers, such, that last digits of their square is equal to 987654321.InputInput contains integer number N (1<=N<=106)OutputWrite answer to the output.Sample In 阅读全文

posted @ 2013-03-16 23:33 仗剑奔走天涯 阅读(167) 评论(0) 推荐(0) 编辑

SGU115 - Calendar

摘要: 115. Calendartime limit per test: 0.5 sec.memory limit per test: 4096 KBFirst year of new millenium is gone away. In commemoration of it write a program that finds the name of the day of the week for any date in 2001.InputInput is a line with two positive integer numbersNandM, whereNis a day number 阅读全文

posted @ 2013-03-16 21:46 仗剑奔走天涯 阅读(174) 评论(0) 推荐(0) 编辑

上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 19 下一页

导航