f[1] = 'b', f[2] = 'a', f[i] = f[i - 1] + f[i - 2]斐波那契数列的字符串,给你n和m,前m位中,最长的前缀等于后缀的长度是多少。1≤n≤1000, 1≤m≤length(f[n])规律题,虽然我不知道为什么。 1 import java.io.*; 2...
分类:
其他好文 时间:
2015-08-04 20:59:19
阅读次数:
115
总算今天静下心来学算法。。DescriptionInnocent Wu follows Dumb Zhang into a ancient tomb. Innocent Wu’s at the entrance of the tomb while Dumb Zhang’s at the end of...
分类:
其他好文 时间:
2015-08-04 20:56:29
阅读次数:
146
DescriptionYour current task is to make a ground plan for a residential building located in HZXJHS. So you must determine a way to split the floor bui...
分类:
其他好文 时间:
2015-08-04 20:55:14
阅读次数:
179
Problem DescriptionThere arenapple trees planted along a cyclic road, which isLmetres long. Your storehouse is built at position0on that cyclic road.T...
分类:
其他好文 时间:
2015-08-04 20:52:18
阅读次数:
212
MZL's City
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 0 Accepted Submission(s): 0
Problem Description
MZL is an active girl...
分类:
其他好文 时间:
2015-08-04 19:28:12
阅读次数:
348
题意是给你一个n*m的有0 1组成的矩阵 起点为坐上角 终点为右下角 从起点走到终点组成的一个二进制数最小;
思路:
1. 如果起点为零 则找到与起点相邻的联通0 的点 找到距离终点最近的一些点 然后找到最小的二进制数(建议用 bfs)
2.起点不为0 则直接从起点开始找最小的二进制数 具体找法为:
把下一步的点走找出来 如果其中有0的点 则不用走位1的点 把...
分类:
其他好文 时间:
2015-08-04 15:37:02
阅读次数:
94
Friends
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1429 Accepted Submission(s): 725
Problem Description
There are n people
...
分类:
其他好文 时间:
2015-08-04 11:19:14
阅读次数:
85
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5324题意:给你一个二维的序列,让你找出最长的第一维升第二维降的子序列(如果多个答案,输出字典序最小)解:考虑从后往前dp,在u点你需要知道u点之后的比u的第一维大,第二维小的dp最大值可以用分治枚举u点...
分类:
其他好文 时间:
2015-08-04 00:26:54
阅读次数:
133
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5297题意:给你一个所有正整数的序列,然后去掉满足x^(2~r)的所有数(x为所有正整数,r>=2题目给出),问你现在这个序列的第n个数是什么解:首先想到写一个函数func(y),它可以计算出给定数字y是...
分类:
其他好文 时间:
2015-08-03 22:16:46
阅读次数:
99
Walk OutTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2912Accepted Submission(s): 599Problem Des...
分类:
其他好文 时间:
2015-08-03 19:00:14
阅读次数:
116