文章分类 -  DP

摘要:Good NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1115 Accepted Submission(s): 414Problem DescriptionIf we sum up every digit of a number and the result can be exactly divided by 10, we say this number is a good number.You are requ... 阅读全文
posted @ 2013-10-05 10:06 heaventouch 阅读(169) 评论(0) 推荐(0)
摘要:wolf5xTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 320 Accepted Submission(s): 205Special JudgeProblem DescriptionThere are n grids in a row. The coordinates of grids are numbered from x=1 to x=n. Someone starts from x=0. You can step for... 阅读全文
posted @ 2013-10-04 19:00 heaventouch 阅读(94) 评论(0) 推荐(0)
摘要:ActivationTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 966 Accepted Submission(s): 353Problem DescriptionAfter 4 years' waiting, the game "Chinese Paladin 5" finally comes out. Tomato is a crazy fan, and luckily he got the first 阅读全文
posted @ 2013-10-04 14:43 heaventouch 阅读(124) 评论(0) 推荐(0)
摘要:Card CollectorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1881 Accepted Submission(s): 872Special JudgeProblem DescriptionIn your childhood, do you crazy for collecting the beautiful cards in the snacks? They said that, for example, if y... 阅读全文
posted @ 2013-10-04 10:07 heaventouch 阅读(130) 评论(0) 推荐(0)
摘要:DiceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 126 Accepted Submission(s): 75Problem DescriptionGiven a normal dice (with 1, 2, 3, 4, 5, 6 on each face), we define: F(N) to be the expected number of tosses until we have a number facing ... 阅读全文
posted @ 2013-10-03 19:51 heaventouch 阅读(177) 评论(0) 推荐(0)
摘要:Aeroplane chessTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 915 Accepted Submission(s): 631Problem DescriptionHzz loves aeroplane chess very much. The chess map contains N+1 grids labeled from 0 to N. Hzz starts at grid 0. For each step h... 阅读全文
posted @ 2013-10-03 15:59 heaventouch 阅读(138) 评论(0) 推荐(0)
摘要:StringTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1162 Accepted Submission(s): 426Problem DescriptionGiven 3 strings A, B, C, find the longest string D which satisfy the following rules:a) D is the subsequence of Ab) D is the subsequence... 阅读全文
posted @ 2013-10-03 09:30 heaventouch 阅读(132) 评论(0) 推荐(0)
摘要:Advanced FruitsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1313 Accepted Submission(s): 648Special JudgeProblem DescriptionThe company "21st Century Fruits" has specialized in creating new sorts of fruits by transferring genes from o 阅读全文
posted @ 2013-10-02 14:53 heaventouch 阅读(163) 评论(0) 推荐(0)
摘要:吉哥系列故事——完美队形ITime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1666 Accepted Submission(s): 482Problem Description 吉哥这几天对队形比较感兴趣。 有一天,有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则称之为完美队形: 1、挑出的人保持他们在原队... 阅读全文
posted @ 2013-10-02 10:06 heaventouch 阅读(141) 评论(0) 推荐(0)
摘要:Greatest Common Increasing SubsequenceTime Limit: 2 Seconds Memory Limit: 65536 KB Special Judge You are given two sequences of integer numbers. Write a program to determine their common increasing subsequence of maximal possible length. Sequence S1, S2, ..., SN of length N is called a... 阅读全文
posted @ 2013-10-02 08:59 heaventouch 阅读(145) 评论(0) 推荐(0)
摘要:最长回文Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6048 Accepted Submission(s): 2073Problem Description给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等 Input输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c...y,z组成的字符串S两组case之间由空行隔... 阅读全文
posted @ 2013-10-01 15:52 heaventouch 阅读(124) 评论(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 阅读(106) 评论(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 阅读(148) 评论(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 阅读(137) 评论(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 阅读(182) 评论(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 阅读(215) 评论(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 阅读(191) 评论(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 阅读(178) 评论(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 阅读(125) 评论(0) 推荐(0)
摘要:Humble NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13655 Accepted Submission(s): 5938Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14... 阅读全文
posted @ 2013-09-20 12:44 heaventouch 阅读(144) 评论(0) 推荐(0)