摘要: Given an n ∗ m chessboard with some marked squares, your task isto place as few queens as possible to guard (attack or occupy) allmarked squares. Belo... 阅读全文
posted @ 2015-11-11 21:34 万俟天亮 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 出处:http://blog.csdn.net/joylnwang/article/details/6778316KMP算法,是由Knuth,Morris,Pratt共同提出的模式匹配算法,其对于任何模式和目标序列,都可以在线性时间内完成匹配查找,而不会发生退化,是一个非常优秀的模式匹配算法。但是相... 阅读全文
posted @ 2015-11-09 20:17 万俟天亮 阅读(270) 评论(0) 推荐(0) 编辑
摘要: Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径... 阅读全文
posted @ 2015-09-10 20:06 万俟天亮 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 网址转载链接: http://bbs.chinaunix.net/thread-4094539-1-1.html动态规划:从新手到专家Hawstein翻译前言我们遇到的问题中,有很大一部分可以用动态规划(简称DP)来解。 解决这类问题可以很大地提升你的能力与技巧,我会试着帮助你理解如何使用DP来解题... 阅读全文
posted @ 2015-09-10 19:10 万俟天亮 阅读(2307) 评论(0) 推荐(3) 编辑
摘要: Problem DescriptionTom and Jerry are playing a game with tubes and pearls. The rule of the game is:1) Tom and Jerry come up together with a number K.2... 阅读全文
posted @ 2015-09-07 11:48 万俟天亮 阅读(176) 评论(0) 推荐(0) 编辑
摘要: DescriptionBackground Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fas... 阅读全文
posted @ 2015-08-31 15:19 万俟天亮 阅读(273) 评论(0) 推荐(0) 编辑
摘要: Yet another Number SequenceLet’s define another number sequence, given by the following function:f(0) = af(1) = bf(n) = f(n − 1) + f(n − 2), n > 1When... 阅读全文
posted @ 2015-08-19 15:22 万俟天亮 阅读(344) 评论(0) 推荐(0) 编辑
摘要: Contemplation! AlgebraGiven the value of a+b and ab you will have to find the value of an + bnInputThe input file contains several lines of inpu... 阅读全文
posted @ 2015-08-18 16:32 万俟天亮 阅读(263) 评论(0) 推荐(0) 编辑
摘要: poj 2488 A Knight's JourneyDescriptionBackground The knight is getting bored of seeing the same black and white squares again and again and has decide... 阅读全文
posted @ 2015-08-13 16:12 万俟天亮 阅读(210) 评论(0) 推荐(0) 编辑
摘要: poj 1129 Channel AllocationDescriptionWhen a radio station is broadcasting over a very large area, repeaters are used to retransmit the sign... 阅读全文
posted @ 2015-08-12 17:29 万俟天亮 阅读(187) 评论(0) 推荐(0) 编辑