随笔分类 -  POJ

摘要:The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, eac 阅读全文
posted @ 2019-03-28 19:22 进击的黑仔 阅读(225) 评论(0) 推荐(0)
摘要:An addition chain for n is an integer sequence <a0, a1,a2,...,am=""> with the following four properties: a0 = 1 am = n a0 < a1 < a2 < ... < am-1 < am 阅读全文
posted @ 2019-03-24 13:39 进击的黑仔 阅读(145) 评论(0) 推荐(0)
摘要:7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体。 设从下往上数第i(1 <= i <= M)层蛋糕是半径为Ri, 高度为Hi的圆柱。当i < M时,要求Ri > Ri+1且Hi > Hi+1。 由于要在蛋糕上抹奶油,为尽可能节约经费,我们希望蛋糕 阅读全文
posted @ 2019-03-22 22:32 进击的黑仔 阅读(733) 评论(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 locating in the sea 阅读全文
posted @ 2018-12-29 17:11 进击的黑仔 阅读(243) 评论(0) 推荐(0)
摘要:Oh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be milked over some precise time interval A..B (1 <= A <= B <= 1,0 阅读全文
posted @ 2018-12-29 12:02 进击的黑仔 阅读(161) 评论(0) 推荐(0)
摘要:To avoid unsightly burns while tanning, each of the C (1 ≤ C ≤ 2500) cows must cover her hide with sunscreen when they're at the beach. Cow i has a mi 阅读全文
posted @ 2018-12-28 19:52 进击的黑仔 阅读(257) 评论(0) 推荐(0)
摘要:The Eight Puzzle, among other sliding-tile puzzles, is one of the famous problems in artificial intelligence. Along with chess, tic-tac-toe and backga 阅读全文
posted @ 2018-12-24 15:49 进击的黑仔 阅读(448) 评论(0) 推荐(0)
摘要:In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacen 阅读全文
posted @ 2018-12-23 20:47 进击的黑仔 阅读(268) 评论(0) 推荐(1)
摘要:For this problem, you will write a program that reads in a sequence of 32-bit signed integers. After each odd-indexed value is read, output the median 阅读全文
posted @ 2018-12-23 19:36 进击的黑仔 阅读(180) 评论(0) 推荐(0)
摘要:Moscow is hosting a major international conference, which is attended by n scientists from different countries. Each of the scientists knows exactly o 阅读全文
posted @ 2018-12-23 13:18 进击的黑仔 阅读(500) 评论(0) 推荐(0)
摘要:Farmer John's farm consists of a long row of N (1 <= N <= 100,000)fields. Each field contains a certain number of cows, 1 <= ncows <= 2000. FJ wants t 阅读全文
posted @ 2018-12-22 14:15 进击的黑仔 阅读(249) 评论(0) 推荐(0)
摘要:Given 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 阅读全文
posted @ 2018-12-21 20:32 进击的黑仔 阅读(338) 评论(0) 推荐(0)
摘要:Consider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 9901) 阅读全文
posted @ 2018-12-17 22:27 进击的黑仔 阅读(268) 评论(0) 推荐(0)
摘要:FJ's N (1 ≤ N ≤ 10,000) cows conveniently indexed 1..N are standing in a line. Each cow has a positive integer height (which is a bit of secret). You 阅读全文
posted @ 2018-12-17 15:30 进击的黑仔 阅读(174) 评论(0) 推荐(0)
摘要:题意:就是让你求出4个塔的汉诺塔的最小移动步数,(1 <= n <= 12) 那么我们知道3个塔的汉诺塔问题的解为:d[n] = 2*d[n-1] + 1 ,可以解释为把n-1个圆盘移动到一个临时柱子上,然后将1个最大圆盘移动到目标的主子,最后再将n-1个圆盘移动到目标柱子。 为什么是n-1和1的组 阅读全文
posted @ 2018-12-10 21:24 进击的黑仔 阅读(168) 评论(0) 推荐(0)