摘要: 转自:http://bbs.dlut.edu.cn/bbstcon.php?board=Competition&gid=23474如何在O(n)时间内处理字符串以每个位置为中心的最长回文。这里转载一个Manacher算法的论文翻译。原文地址:http://zhuhongcheng.wordpress.com/2009/08/02/a-simple-linear-time-algorithm-for-finding-longest-palindrome-sub-string/ 其实原文说得是比较清楚的,只是英文的,我这里写一份中文的吧。 首先:大家都知道什么叫回文串吧,这个算法要解决的就 阅读全文
posted @ 2013-10-01 15:48 heaventouch 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Greatest Common Increasing SubsequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3079 Accepted Submission(s): 969Problem DescriptionThis is a problem from ZOJ 2432.To make it easyer,you just need output the length of the subsequence. In... 阅读全文
posted @ 2013-10-01 11:45 heaventouch 阅读(103) 评论(0) 推荐(0) 编辑
摘要: The more, The BetterTime Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4407 Accepted Submission(s): 2612Problem DescriptionACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy... 阅读全文
posted @ 2013-09-30 19:50 heaventouch 阅读(142) 评论(0) 推荐(0) 编辑
摘要: N!Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 44897 Accepted Submission(s): 12748Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N! InputOne N in one line, process to the end of file. OutputFor each N, ou... 阅读全文
posted @ 2013-09-29 17:46 heaventouch 阅读(145) 评论(0) 推荐(0) 编辑
摘要: To The MaxTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6742 Accepted Submission(s): 3226Problem DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1 x 1 or great... 阅读全文
posted @ 2013-09-29 09:11 heaventouch 阅读(134) 评论(0) 推荐(0) 编辑
摘要: LOOPSTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 125536/65536 K (Java/Others)Total Submission(s): 1291 Accepted Submission(s): 531Problem DescriptionAkemi Homura is a Mahou Shoujo (Puella Magi/Magical Girl).Homura wants to help her friend Madoka save the world. But because of the plo... 阅读全文
posted @ 2013-09-28 23:58 heaventouch 阅读(177) 评论(0) 推荐(0) 编辑
摘要: String painterTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1257 Accepted Submission(s): 532Problem DescriptionThere are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string ... 阅读全文
posted @ 2013-09-28 18:35 heaventouch 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 不要62Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13946 Accepted Submission(s): 4477Problem Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315... 阅读全文
posted @ 2013-09-28 10:28 heaventouch 阅读(184) 评论(0) 推荐(0) 编辑
摘要: BombTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 4757 Accepted Submission(s): 1652Problem DescriptionThe counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the ... 阅读全文
posted @ 2013-09-27 09:30 heaventouch 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Girls and BoysTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6148Accepted Submission(s): 2750Problem Descriptionthe second year of the university somebody started a study on the romantic relations between the students. The relation “romantically 阅读全文
posted @ 2013-09-25 23:01 heaventouch 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Function Run FunTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 15171Accepted: 7849DescriptionWe all love recursion! Don't we? Consider a three-parameter recursive function w(a, b, c):if a 20 or b > 20 or c > 20, then w(a, b, c) returns:w(20, 20, 20)if a #includeint dp[25][25][25] 阅读全文
posted @ 2013-09-25 22:35 heaventouch 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Image PerimetersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 7194 Accepted: 4299DescriptionTechnicians in a pathology lab analyze digitized images of slides. Objects on a slide are selected for analysis by a mouse click on the object. The perimeter of the boundary of an object is one u. 阅读全文
posted @ 2013-09-24 13:07 heaventouch 阅读(127) 评论(0) 推荐(0) 编辑
摘要: S-NimTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3526 Accepted Submission(s): 1550Problem DescriptionArthur and his sister Caroll have been playing a game called Nim for some time now. Nim is played as follows: The starting position has... 阅读全文
posted @ 2013-09-24 10:46 heaventouch 阅读(226) 评论(0) 推荐(0) 编辑
摘要: Open the LockTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3210 Accepted Submission(s): 1412Problem 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... 阅读全文
posted @ 2013-09-23 21:13 heaventouch 阅读(138) 评论(0) 推荐(0) 编辑
摘要: CoinsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5407 Accepted Submission(s): 2230Problem DescriptionWhuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins... 阅读全文
posted @ 2013-09-23 09:13 heaventouch 阅读(118) 评论(0) 推荐(1) 编辑