题目传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1029 看来写这类题目必须要创新的思路,纯粹的写循环很容易被大数据爆掉。下面是一份超时代码,目前还没有发现原因,没有死循环,目测是数据量大的原因? #include<stdio.h>#include<string.h>#include<algorithm>//#define LOCAL
题目连接:10635 - Prince and Princess 题目大意:给出n, m, k,求两个长度分别为m + 1 和 k + 1且由1~n * n组成的序列的最长公共子序列长的。 解题思路:按一般的o(n^2)的算法超时了,所以上网查了下LCS装换成LIS的算法o(nlogn)。算法仅仅是将其中的一个序列重新标号1~m,然后按最长公共子序列的方法去做。 #in
题目: "OK, you are not too bad, em... But you can never pass the next test." feng5166 says. "I will tell you an odd number N, and then N integers. There will be a special integer among them, you ha
Problem Description “Well, it seems the first problem is too easy. I will let you know how foolish you are later.” feng5166 says. “The second problem is, given an positive integer N, we define an eq
Hug the princess Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit Status There is a sequence with nn elements. Assuming they are a1,a2,⋯,ana1,a2,⋯,an
Hug the princess Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit Status There is a sequence with nn elements. Assuming they are a1,a2,⋯,ana1,a2,⋯,an
Hug the princess Time Limit: 1000MS Memory Limit: 65535KB 64bit IO Format: %lld & %llu Submit Status Description There is a sequence with n elements. Assuming they are a1,a2,⋯,a
Hug the princess Time Limit: 1000MS Memory Limit: 65535KB 64bit IO Format: %lld & %llu Submit Status Description There is a sequence with n elements. Assuming they are a1,a2,⋯,a
【题目来源】http://acm.hdu.edu.cn/showproblem.php?pid=1027【题目描述】 Now our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty Princess. But now the
“OK, you are not too bad, em… But you can never pass the next test.” feng5166 says. “I will tell you an odd number N, and then N integers. There will be a special integer among them, you have to tel