摘要: Bone CollectorTime Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 14 Accepted Submission(s) : 7Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as d 阅读全文
posted @ 2012-07-19 13:20 Robot_Asia 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 数塔Time Limit : 1000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 9 Accepted Submission(s) : 8Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少? 已经告诉你了,这是个DP的题目,你能AC吗?Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数. 阅读全文
posted @ 2012-07-18 20:12 Robot_Asia 阅读(2146) 评论(0) 推荐(0) 编辑
摘要: 最大连续子序列Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 11 Accepted Submission(s) : 7Problem Description给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 <= i <= j <= K。最大连续子序列是所有连续子序列中元素和最大的一个, 例如给定序列{ -2, 11, -4, 13, -5, 阅读全文
posted @ 2012-07-18 16:58 Robot_Asia 阅读(3524) 评论(2) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<string.h> 3 4 int prime[38]={0,0,1,1,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1}; 5 int visit[21],result[21]; 6 int n; 7 8 int dfs(int num) 9 {10 int print(int m);11 int i;12 if(num==n && prime[result[num]+result[1]])13 p... 阅读全文
posted @ 2012-06-21 23:53 Robot_Asia 阅读(730) 评论(0) 推荐(0) 编辑