上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 50 下一页
摘要: BFS就好了变形课Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 9011Accepted Submission(s): 3360Problem Description呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果咒语是以a开头b结尾的一个单词,那么它的作用就恰好是使A物体变成B物体.Harry已经将他所会的所有咒语 阅读全文
posted @ 2013-05-23 01:34 码代码的猿猿 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 编程之美2.3每次减去2个不同的值,到最后留下来的就是水王gnatius and the Princess IVTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32767 K (Java/Others)Total Submission(s): 12168Accepted Submission(s): 4848Problem Description"OK, you are not too bad, em... But you can never pass the next test." feng5166 sa 阅读全文
posted @ 2013-05-23 01:32 码代码的猿猿 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 类似于LCS问题。可得到如下的状态方程:设f(i,j)为第一个序列(p)的前i个数和第二个序列(b)的前j个数的相似度的最大值。当p[i]==b[j]时,由题目给出的表显然可以得出f(i,j)=f(i-1,j-1)+c[p[i]][b[j]];c组为题目中给出的那个表格。当p[i]!=b[j]时,反证法显然有f(i,j)=max(f(i-1,j-1)+c[p[i]][b[j]],f(i-1,j)+c[a[i]][4],c(i,j-1)+c[4][b[j]])。其中 A C G T - 分别对应于 0 1 2 3 4需要注意对f[i][0] 和 f[0][i]的赋值。Human Gene Fun 阅读全文
posted @ 2013-05-22 10:15 码代码的猿猿 阅读(152) 评论(0) 推荐(0) 编辑
摘要: LCIS+记录路径LCIS:dp[i][j] 表示数列a前i项,和数列b前j项且以b[ j ]结尾的LCIS。当a[ i ]!= b[ j ]时,dp[ i ][ j ]==dp[i-1][ j ]当a[ i ]==b[ j ]时,dp[ i ][ j ]==dp[i-1][1~j之间最大的]+1最后 统计 dp[len(a)][...]里最大的就是LICSGreatest Common Increasing SubsequenceTime Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total 阅读全文
posted @ 2013-05-22 10:14 码代码的猿猿 阅读(332) 评论(0) 推荐(0) 编辑
摘要: Brackets SequenceTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 21666Accepted: 6068Special JudgeDescriptionLet us define a regular brackets sequence in the following way: 1. Empty sequence i... 阅读全文
posted @ 2013-05-22 00:57 码代码的猿猿 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 将点排序,再按从小到大的顺序DP滑雪Time Limit:1000MSMemory Limit:65536KTotal Submissions:65761Accepted:24114DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12 11 10 9一个人可 阅读全文
posted @ 2013-05-21 17:01 码代码的猿猿 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 黑书动态规划第一题 Brackets SequenceTime Limit:1000MSMemory Limit:65536KTotal Submissions:21666Accepted:6068Special JudgeDescriptionLet us define a regular brackets sequence in the following way:1. Empty sequence is a regular sequence.2. If S is a regular sequence, then (S) and [S] are b... 阅读全文
posted @ 2013-05-21 16:59 码代码的猿猿 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 枚举行之间的组合,在求最大连续和。上学期好像就做过的。。。。。和City Game有种一样的感觉。To the MaxTime Limit:1000MSMemory Limit:10000KTotal Submissions:35605Accepted:18697DescriptionGiven 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 whole 阅读全文
posted @ 2013-05-20 19:38 码代码的猿猿 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 11613675CKboss1159Accepted792K1110MSG++635B2013-05-19 15:51:30#include #include #include using namespace std;int dp[2][5555];int main(){ char s1[5555],s2[5555]; s1[0]=s2[0]=':'; int n; cin... 阅读全文
posted @ 2013-05-19 23:53 码代码的猿猿 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Humble NumbersTime Limit:1000MSMemory Limit:65536KTotal Submissions:8704Accepted:4115DescriptionA 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, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first... 阅读全文
posted @ 2013-05-19 21:15 码代码的猿猿 阅读(182) 评论(0) 推荐(0) 编辑
上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 50 下一页