Bridging signals Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9234   Accepted: 5037 Description 'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up co…
Bridging signals Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2354    Accepted Submission(s): 1536 Problem Description 'Oh no, they've done it again', cries the chief designer at the Waferlan…
这个博客说的已经很好了.http://blog.csdn.net/shuangde800/article/details/7474903 简单记录一下自己学的: 问题就是求一个数列最长上升子序列的长度. 如果子序列长度相同,那么末尾小的子序列更有可能成为最长的子序列.所以就用一个l数组存当子序列长度为len时最小的末尾元素.如果序列下一个值比l[len]大,说明上升子序列长度增加,那么l[len++]=a[i];如果是小,就想办法把它插入到了l数组中.... HDU 1950 说白了就是求lis…
//Accepted 3540 KB 62 ms //dp 最长上升子序列 #include <cstdio> #include <cstring> #include <iostream> using namespace std; ; int dp[imax_n]; int d[imax_n]; int a[imax_n]; int n; int len; int max(int a,int b) { return a>b?a:b; } int binary_se…
http://acm.split.hdu.edu.cn/showproblem.php?pid=1950 题意:求最长上升(不连续or连续)子序列 推荐博客链接: http://blog.csdn.net/sinat_30062549/article/details/47197073 #include <iostream> #include <stdio.h> #include <string.h> #include <string> #include &l…
Bridging signals Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 961    Accepted Submission(s): 627 Problem Description 'Oh no, they've done it again', cries the chief designer at the Waferland…
题意 给出一个序列 问它的最长严格上升子序列多长 这个序列中的0可以被替代为任何数 n的范围给出了1e5 所以平常的O(n*n)lis不能用了 在kuangbin的模板里有O(nlogn)的模板 套上就可以过了 但是比赛的时候没有拿模板= =. 于是就想出了另外一个时间复杂度不明的办法= =. 将序列从前往后扫 设定一个数组a a[i]=z a[i]为当前i长度的上升子序列中的最小的尾数的大小 maxl为当前找出的最长的子序列长度 每次我们扫到一个数 都对0-maxl长度的a[i]进行判断 看能…
Bellovin Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 858    Accepted Submission(s): 395 Problem Description Peter has a sequence a1,a2,...,an and he define a function on the sequence -- F(…
题意是要在两条平行线间连点,要在线不交叉的前提下尽可能多的连线,问最多能连多少条线. 现假定题中所给的是 9 组点,分别是:1—3,2—8,3—5,4—9,5—2,6—4,7—6,8—7,9—1,如图示:  则将所给的每组 p 和 r 存在数组 a[ ] 中:a[ p ] = r: 问题就转化成了在数组 a[ ] 中求最长上升子序列的长度.显然要是直接暴力做的话,每个数字都有选和不选两种可能,那么就是 O( 2 ^ n ) 的复杂度,这是无法接受的. 除暴力外求解最长上升子序列长度的方法有三种(…
Common Subsequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 32693    Accepted Submission(s): 14786 Problem Description A subsequence of a given sequence is the given sequence with some el…