摘要: Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi 阅读全文
posted @ 2018-01-29 22:20 StarHai 阅读(383) 评论(0) 推荐(0) 编辑
摘要: Farmer 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 阅读全文
posted @ 2018-01-29 21:54 StarHai 阅读(291) 评论(0) 推荐(0) 编辑
摘要: Demy has n jewels. Each of her jewels has some value vi and weight wi. Since her husband John got broke after recent financial crises, Demy has decide 阅读全文
posted @ 2018-01-29 21:34 StarHai 阅读(225) 评论(0) 推荐(0) 编辑
摘要: The 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 阅读全文
posted @ 2018-01-29 20:52 StarHai 阅读(416) 评论(0) 推荐(0) 编辑
摘要: Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point loca... 阅读全文
posted @ 2018-01-29 20:44 StarHai 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Give you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers ... 阅读全文
posted @ 2018-01-29 20:44 StarHai 阅读(231) 评论(0) 推荐(0) 编辑
摘要: You are given a rectangular field of n × m cells. Each cell is either empty or impassable (contains an obstacle). Empty cells are marked with '.', imp 阅读全文
posted @ 2018-01-29 20:22 StarHai 阅读(192) 评论(0) 推荐(0) 编辑
摘要: You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. 阅读全文
posted @ 2018-01-29 20:12 StarHai 阅读(254) 评论(0) 推荐(0) 编辑
摘要: Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square? InputThe first line of input contai... 阅读全文
posted @ 2018-01-29 20:05 StarHai 阅读(223) 评论(0) 推荐(0) 编辑
摘要: Alex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game a... 阅读全文
posted @ 2018-01-29 19:56 StarHai 阅读(187) 评论(0) 推荐(0) 编辑