摘要: DescriptionThe SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d = 0 . In the following, we assume that all lists have the same size n .InputThe first line of the input file c 阅读全文
posted @ 2013-08-06 00:58 小の泽 阅读(139) 评论(0) 推荐(0) 编辑
摘要: DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ≤ 10,000) that he will need to spend each day over the next N (1 ≤ N ≤ 100,000) days.FJ wants to create a 阅读全文
posted @ 2013-08-06 00:55 小の泽 阅读(114) 评论(0) 推荐(0) 编辑
摘要: DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square plots. It then analyzes each plot separately, using sensing e 阅读全文
posted @ 2013-08-06 00:52 小の泽 阅读(155) 评论(0) 推荐(0) 编辑
摘要: There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can't move on red tiles, he can move only on black tiles.Write a program to count the number of blac 阅读全文
posted @ 2013-08-06 00:49 小の泽 阅读(238) 评论(0) 推荐(0) 编辑
摘要: DescriptionOne day a highly important task was commissioned to Vasya — writing a program in a night. The program consists of n lines of code. Vasya is already exhausted, so he works like that: first he writes v lines of code, drinks a cup of tea, then he writes as much as lines, drinks another cup o 阅读全文
posted @ 2013-08-06 00:46 小の泽 阅读(234) 评论(0) 推荐(0) 编辑
摘要: Description一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m=1.m=0退出.Output输出从第m个城市出发经过每个城市1次又回到m的所有路线,如有多条路线,按字典序输出,每行1条路线.每行首先输出是第几条路线.然后个一个: 后列出经过的城市.参看Sample outputSample Input2 5 201 3 122 4 103 5 81 4 65 7 196 8 174 7 98 10 163 9 1110 阅读全文
posted @ 2013-08-06 00:42 小の泽 阅读(155) 评论(0) 推荐(0) 编辑
摘要: time limit per test1 secondmemory limit per test256 megabytesYou are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are numbered 1 through n from top to bottom, 阅读全文
posted @ 2013-08-06 00:39 小の泽 阅读(235) 评论(0) 推荐(0) 编辑
摘要: DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.InputThe first line of the input contains an integer T(1 2 #include 3 4 using namespace std; 5 6 int.. 阅读全文
posted @ 2013-08-06 00:36 小の泽 阅读(113) 评论(0) 推荐(0) 编辑
摘要: DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.The game can be played by two or more than two players. It consists of a chessboard(棋盘)and some chessmen 阅读全文
posted @ 2013-08-06 00:33 小の泽 阅读(160) 评论(0) 推荐(0) 编辑
摘要: DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there exists a strictly increasing sequence of indices of X such that for all j = 1,2,...,k, xij = zj. For example, Z ... 阅读全文
posted @ 2013-08-06 00:28 小の泽 阅读(151) 评论(0) 推荐(0) 编辑
摘要: DescriptionNow an emergent task for you is to open a password lock. The password is consisted of four digits. Each digit is numbered from 1 to 9.Each time, you can add or minus 1 to any digit. When add 1 to '9', the digit will change to be '1' and when minus 1 to '1', the dig 阅读全文
posted @ 2013-08-06 00:24 小の泽 阅读(177) 评论(0) 推荐(0) 编辑
摘要: DescriptionA factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are always delivered to customers in the square parcels of the same height h as the products have and of the size 6*6. Because of the expenses it is the 阅读全文
posted @ 2013-08-06 00:18 小の泽 阅读(473) 评论(0) 推荐(0) 编辑
摘要: DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs some time, called setup time, for the machine to prepare processing a stick. The setup times are associated 阅读全文
posted @ 2013-08-06 00:14 小の泽 阅读(185) 评论(0) 推荐(0) 编辑