2013年8月10日

POJ 1330 Nearest Common Ancestors

摘要: Nearest Common AncestorsTime Limit:1000MSMemory Limit:10000KTotal Submissions:14698Accepted:7839DescriptionA rooted tree is a well-known data structure in computer science and engineering. An example is shown below:In the figure, each node is labeled with an integer from {1, 2,...,16}. Node 8 is the 阅读全文

posted @ 2013-08-10 15:20 lzm风雨无阻 阅读(613) 评论(0) 推荐(0) 编辑

POJ 1661 Help Jimmy

摘要: Help JimmyTime Limit:1000MSMemory Limit:10000KTotal Submissions:8011Accepted:2549Description"Help Jimmy" 是在下图所示的场景上完成的游戏。场景中包括多个长度和高度各不相同的平台。地面是最低的平台,高度为零,长度无限。Jimmy老鼠在时刻0从高于所有平台的某处开始下落,它的下落速度始终为1米/秒。当Jimmy落到某个平台上时,游戏者选择让它向左还是向右跑,它跑动的速度也是1米/秒。当Jimmy跑到平台的边缘时,开始继续下落。Jimmy每次下落的高度不能超过MAX米,不然就会 阅读全文

posted @ 2013-08-10 12:26 lzm风雨无阻 阅读(457) 评论(0) 推荐(1) 编辑

2013年8月8日

POJ 1145 Tree Summing

摘要: Tree SummingTime Limit:1000MSMemory Limit:10000KTotal Submissions:7698Accepted:1737DescriptionLISP was one of the earliest high-level programming languages and, with FORTRAN, is one of the oldest languages currently being used. Lists, which are the fundamental data structures in LISP, can easily be 阅读全文

posted @ 2013-08-08 20:06 lzm风雨无阻 阅读(444) 评论(0) 推荐(0) 编辑

2013年8月7日

POJ 1338 Ugly Numbers

摘要: Ugly NumbersTime Limit:1000MSMemory Limit:10000KTotal Submissions:18395Accepted:8138DescriptionUgly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence1, 2, 3, 4, 5, 6, 8, 9, 10, 12, ...shows the first 10 ugly numbers. By convention, 1 is included.Given the integer n,write a pro 阅读全文

posted @ 2013-08-07 22:29 lzm风雨无阻 阅读(303) 评论(0) 推荐(0) 编辑

POJ 2247 Humble Numbers

摘要: Humble NumbersTime Limit:1000MSMemory Limit:65536KTotal Submissions:8831Accepted:4185DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers.Write 阅读全文

posted @ 2013-08-07 22:19 lzm风雨无阻 阅读(317) 评论(0) 推荐(0) 编辑

POJ 2236 Wireless Network

摘要: Wireless NetworkTime Limit:10000MSMemory Limit:65536KTotal Submissions:14018Accepted:5942DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the n 阅读全文

posted @ 2013-08-07 20:54 lzm风雨无阻 阅读(254) 评论(0) 推荐(0) 编辑

POJ 2021 Relative Relatives

摘要: Relative RelativesTime Limit:1000MSMemory Limit:30000KTotal Submissions:3339Accepted:1462DescriptionToday is Ted's 100th birthday. A few weeks ago, you were selected by the family to contact all of Ted's descendants and organize a surprise party. To make this task easier, you created an age- 阅读全文

posted @ 2013-08-07 15:41 lzm风雨无阻 阅读(247) 评论(0) 推荐(0) 编辑

2013年8月6日

POJ 1656 Counting Black

摘要: Counting BlackTime Limit:1000MSMemory Limit:10000KTotal Submissions:9772Accepted:6307DescriptionThere is a board with 100 * 100 grids as shown below. The left-top gird is denoted as (1, 1) and the right-bottom grid is (100, 100).We may apply three commands to the board:1. WHITE x, y, L // Paint... 阅读全文

posted @ 2013-08-06 21:53 lzm风雨无阻 阅读(282) 评论(0) 推荐(0) 编辑

POJ 2248 Addition Chains

摘要: Addition ChainsTime Limit:1000MSMemory Limit:65536KTotal Submissions:4480Accepted:2454Special JudgeDescriptionAn addition chain for n is an integer sequencewith the following four properties:a0 = 1am = na0 and are both valid solutions when you are asked for an addition chain for 5.InputThe input w.. 阅读全文

posted @ 2013-08-06 17:21 lzm风雨无阻 阅读(341) 评论(0) 推荐(0) 编辑

POJ 1323 Game Prediction

摘要: Game PredictionTime Limit:1000MSMemory Limit:10000KTotal Submissions:8956Accepted:4269DescriptionSuppose there are M people, including you, playing a special card game. At the beginning, each player receives N cards. The pip of a card is a positive integer which is at most N*M. And there are no two 阅读全文

posted @ 2013-08-06 15:51 lzm风雨无阻 阅读(329) 评论(0) 推荐(0) 编辑

POJ 1315 Don't Get Rooked

摘要: Don't Get RookedTime Limit:1000MSMemory Limit:10000KTotal Submissions:2086Accepted:1325DescriptionIn chess, the rook is a piece that can move any number of squares vertically or horizontally. In this problem we will consider small chess boards (at most 4x4) that can also contain walls through wh 阅读全文

posted @ 2013-08-06 11:46 lzm风雨无阻 阅读(593) 评论(0) 推荐(0) 编辑

2013年8月5日

POJ 2051 Argus

摘要: ArgusTime Limit:1000MSMemory Limit:30000KTotal Submissions:8782Accepted:3985DescriptionA data stream is a real-time, continuous, ordered sequence of items. Some examples include sensor data, Internet traffic, financial tickers, on-line auctions, and transaction logs such as Web usage logs and teleph 阅读全文

posted @ 2013-08-05 21:55 lzm风雨无阻 阅读(328) 评论(0) 推荐(0) 编辑

POJ 1942 Paths on a Grid

摘要: Paths on a GridTime Limit:1000MSMemory Limit:30000KTotal Submissions:19524Accepted:4735DescriptionImagine you are attending your math lesson at school. Once again, you are bored because your teacher tells things that you already mastered years ago (this time he's explaining that (a+b)2=a2+2ab+b2 阅读全文

posted @ 2013-08-05 10:03 lzm风雨无阻 阅读(420) 评论(0) 推荐(0) 编辑

2013年8月4日

POJ 2151 Check the difficulty of problems

摘要: Check the difficulty of problemsTime Limit:2000MSMemory Limit:65536KTotal Submissions:3810Accepted:1666DescriptionOrganizing a programming contest is not an easy job. To avoid making the problems too difficult, the organizer usually expect the contest result satisfy the following two terms:1. All of 阅读全文

posted @ 2013-08-04 17:04 lzm风雨无阻 阅读(279) 评论(0) 推荐(0) 编辑

POJ 3349 Snowflake Snow Snowflakes

摘要: Snowflake Snow SnowflakesTime Limit:4000MSMemory Limit:65536KTotal Submissions:27086Accepted:7138DescriptionYou may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Your program will read information about a collection of snowflak 阅读全文

posted @ 2013-08-04 14:56 lzm风雨无阻 阅读(720) 评论(0) 推荐(1) 编辑

POJ 1753 Flip Game

摘要: Flip GameTime Limit:1000MSMemory Limit:65536KTotal Submissions:25328Accepted:10930DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other one is black and each piece is lying either it's black 阅读全文

posted @ 2013-08-04 10:42 lzm风雨无阻 阅读(252) 评论(0) 推荐(0) 编辑

2013年8月3日

POJ 2392 Space Elevator

摘要: Space ElevatorTime Limit:1000MSMemory Limit:65536KTotal Submissions:7150Accepted:3352DescriptionThe cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 #include #include #include using namespace std;typedef struct{ int ... 阅读全文

posted @ 2013-08-03 21:42 lzm风雨无阻 阅读(267) 评论(0) 推荐(0) 编辑

POJ 2385 Apple Catching

摘要: Apple CatchingTime Limit:1000MSMemory Limit:65536KTotal Submissions:6350Accepted:3077DescriptionIt is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, each full of apples. Bessie cannot reach the apples when they are o 阅读全文

posted @ 2013-08-03 14:57 lzm风雨无阻 阅读(687) 评论(0) 推荐(0) 编辑

POJ 2356 Find a multiple

摘要: Find a multipleTime Limit:1000MSMemory Limit:65536KTotal Submissions:4934Accepted:2139Special JudgeDescriptionThe input contains N natural (i.e. positive integer) numbers ( N #include using namespace std;int n;int num[10005];int result[10005];int visted[10005];bool DFS(int nCount, int sum){ if (n... 阅读全文

posted @ 2013-08-03 10:35 lzm风雨无阻 阅读(184) 评论(0) 推荐(0) 编辑

2013年8月2日

POJ 2355 Railway tickets

摘要: Railway ticketsTime Limit:1000MSMemory Limit:65536KTotal Submissions:2472Accepted:865DescriptionThe railway line "Ekaterinburg-Sverdlovsk" with several stations has been built. This railway line can be represented as a line segment, railway stations being points on it. The railway line sta 阅读全文

posted @ 2013-08-02 21:30 lzm风雨无阻 阅读(580) 评论(0) 推荐(0) 编辑

POJ 2353 Ministry

摘要: MinistryTime Limit:1000MSMemory Limit:65536KTotal Submissions:4220Accepted:1348Special JudgeDescriptionMr. F. wants to get a document be signed by a minister. A minister signs a document only if it is approved by his ministry. The ministry is an M-floor building with floors numbered from 1 to M, 1#i 阅读全文

posted @ 2013-08-02 20:09 lzm风雨无阻 阅读(283) 评论(0) 推荐(0) 编辑

2013年8月1日

POJ 2181 Jumping Cows

摘要: Jumping CowsTime Limit:1000MSMemory Limit:65536KTotal Submissions:6398Accepted:3828DescriptionFarmer John's cows would like to jump over the moon, just like the cows in their favorite nursery rhyme. Unfortunately, cows can not jump.The local witch doctor has mixed up P (1 #include #include using 阅读全文

posted @ 2013-08-01 21:52 lzm风雨无阻 阅读(337) 评论(0) 推荐(0) 编辑

POJ 2063 Investment

摘要: InvestmentTime Limit:1000MSMemory Limit:30000KTotal Submissions:6836Accepted:2367DescriptionJohn never knew he had a grand-uncle, until he received the notary's letter. He learned that his late grand-uncle had gathered a lot of money, somewhere in South-America, and that John was the only inheri 阅读全文

posted @ 2013-08-01 19:12 lzm风雨无阻 阅读(320) 评论(0) 推荐(0) 编辑

POJ 2033 Alphacode

摘要: AlphacodeTime Limit:1000MSMemory Limit:30000KTotal Submissions:11666Accepted:3564DescriptionAlice and Bob need to send secret messages to each other and are discussing ways to encode their messages:Alice: "Let's just use a very simple code: We'll assign 'A' the code word 1, ' 阅读全文

posted @ 2013-08-01 16:36 lzm风雨无阻 阅读(323) 评论(0) 推荐(0) 编辑

POJ 2029 Get Many Persimmon Trees

摘要: Get Many Persimmon TreesTime Limit:1000MSMemory Limit:30000KTotal Submissions:3160Accepted:2057DescriptionSeiji Hayashi had been a professor of the Nisshinkan Samurai School in the domain of Aizu for a long time in the 18th century. In order to reward him for his meritorious career in education, Kat 阅读全文

posted @ 2013-08-01 15:52 lzm风雨无阻 阅读(330) 评论(0) 推荐(0) 编辑

2013年7月31日

POJ 2018 Best Cow Fences

摘要: Best Cow FencesTime Limit:1000MSMemory Limit:30000KTotal Submissions:8772Accepted:2802DescriptionFarmer John's farm consists of a long row of N (1 #include #include using namespace std;int num[100020];int sum[100020];int main(){ int n, f; int ans; while(scanf("%d%d", &n, &f) != 阅读全文

posted @ 2013-07-31 22:34 lzm风雨无阻 阅读(463) 评论(0) 推荐(0) 编辑

POJ 1989 The Cow Lineup

摘要: The Cow LineupTime Limit:1000MSMemory Limit:30000KTotal Submissions:4965Accepted:2966DescriptionFarmer John's N cows (1 #include #include using namespace std;int cow[100005];int visited[100005];int main(){ int n, k, nCount = 0, ans = 0; scanf("%d%d", &n, &k); for (int i = 0; i 阅读全文

posted @ 2013-07-31 17:25 lzm风雨无阻 阅读(402) 评论(0) 推荐(0) 编辑

2013年7月30日

POJ 1953 World Cup Noise

摘要: World Cup NoiseTime Limit:1000MSMemory Limit:30000KTotal Submissions:14397Accepted:7129DescriptionBackground"KO-RE-A, KO-RE-A" shout 54.000 happy football fans after their team has reached the semifinals of the FIFA World Cup in their home country. But although their excitement is real, th 阅读全文

posted @ 2013-07-30 21:21 lzm风雨无阻 阅读(418) 评论(0) 推荐(0) 编辑

POJ 1952

摘要: BUY LOW, BUY LOWERTime Limit:1000MSMemory Limit:30000KTotal Submissions:7748Accepted:2678DescriptionThe advice to "buy low" is half the formula to success in the bovine stock market.To be considered a great investor you must also follow this problems' advice: "Buy low; buy lower&q 阅读全文

posted @ 2013-07-30 20:34 lzm风雨无阻 阅读(558) 评论(0) 推荐(0) 编辑

POJ 1740 A New Stone Game

摘要: A New Stone GameTime Limit:1000MSMemory Limit:30000KTotal Submissions:4431Accepted:2388DescriptionAlice and Bob decide to play a new stone game.At the beginning of the game they pick n(1#include #include using namespace std;int main(){ int Count[105]; int n, x; while(scanf("%d", &n) != 阅读全文

posted @ 2013-07-30 15:54 lzm风雨无阻 阅读(313) 评论(0) 推荐(0) 编辑

2013年7月24日

POJ 1690 (Your)((Term)((Project)))

摘要: (Your)((Term)((Project)))Time Limit:1000MSMemory Limit:10000KTotal Submissions:2912Accepted:1084DescriptionYou have typed the report of your term project in your personal computer. There are several one line arithmetic expressions in your report. There is no redundant parentheses in the expressions 阅读全文

posted @ 2013-07-24 21:05 lzm风雨无阻 阅读(645) 评论(0) 推荐(0) 编辑

POJ 1609 Tiling Up Blocks

摘要: Tiling Up BlocksTime Limit:1000MSMemory Limit:10000KTotal Submissions:4675Accepted:1824DescriptionMichael The Kid receives an interesting game set from his grandparent as his birthday gift. Inside the game set box, there are n tiling blocks and each block has a form as follows:Each tiling block is a 阅读全文

posted @ 2013-07-24 16:01 lzm风雨无阻 阅读(369) 评论(0) 推荐(0) 编辑

2013年7月23日

POJ 1456 Supermarket

摘要: SupermarketTime Limit:2000MSMemory Limit:65536KTotal Submissions:7764Accepted:3297DescriptionA supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the sale beg 阅读全文

posted @ 2013-07-23 16:13 lzm风雨无阻 阅读(598) 评论(0) 推荐(0) 编辑

POJ 1322 Chocolate

摘要: ChocolateTime Limit:2000MSMemory Limit:65536KTotal Submissions:7652Accepted:2003Special JudgeDescriptionIn 2100, ACM chocolate will be one of the favorite foods in the world."Green, orange, brown, red...", colorful sugar-coated shell maybe is the most attractive feature of ACM chocolate. H 阅读全文

posted @ 2013-07-23 15:23 lzm风雨无阻 阅读(821) 评论(1) 推荐(0) 编辑

2013年7月22日

POJ 1163 The Triangle

摘要: The TriangleTime Limit:1000MSMemory Limit:10000KTotal Submissions:33476Accepted:19865Description73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that starts at the top and ends somewh... 阅读全文

posted @ 2013-07-22 22:02 lzm风雨无阻 阅读(306) 评论(0) 推荐(0) 编辑

POJ 1157 LITTLE SHOP OF FLOWERS

摘要: LITTLE SHOP OF FLOWERSTime Limit:1000MSMemory Limit:10000KTotal Submissions:16356Accepted:7575DescriptionYou want to arrange the window of your flower shop in a most pleasant way. You have F bunches of flowers, each being of a different kind, and at least as many vases ordered in a row. The vases ar 阅读全文

posted @ 2013-07-22 21:41 lzm风雨无阻 阅读(601) 评论(0) 推荐(0) 编辑

POJ 1083 Moving Tables

摘要: Moving TablesTime Limit:1000MSMemory Limit:10000KTotal Submissions:23557Accepted:7795DescriptionThe famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure.The floor has 200 rooms each on the north side and south side along the corridor. R 阅读全文

posted @ 2013-07-22 16:58 lzm风雨无阻 阅读(305) 评论(0) 推荐(0) 编辑

POJ 1050 To the Max

摘要: To the MaxTime Limit:1000MSMemory Limit:10000KTotal Submissions:36627Accepted:19262DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a rectangle is the sum of all t 阅读全文

posted @ 2013-07-22 11:58 lzm风雨无阻 阅读(217) 评论(0) 推荐(0) 编辑

2013年7月21日

POJ 2386 Lake Counting

摘要: Lake CountingTime Limit:1000MSMemory Limit:65536KTotal Submissions:15978Accepted:8079DescriptionDue to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 #include using namespace std;char Map[105][105];int m, n;void DFS(int x, 阅读全文

posted @ 2013-07-21 21:50 lzm风雨无阻 阅读(233) 评论(0) 推荐(0) 编辑

POJ 2157 Maze

摘要: MazeTime Limit:2000MSMemory Limit:65536KTotal Submissions:3183Accepted:996DescriptionAcm, a treasure-explorer, is exploring again. This time he is in a special maze, in which there are some doors (at most 5 doors, represented by 'A', 'B', 'C', 'D', 'E' respect 阅读全文

posted @ 2013-07-21 21:22 lzm风雨无阻 阅读(640) 评论(0) 推荐(0) 编辑

导航