2013年3月28日

PKU POJ 3903 Stock Exchange 最长递增子序列

摘要: 必须要nlogn算法才能过View Code #include <iostream>#include <string.h>#include <stdlib.h>#include <algorithm>using namespace std;int L,a[100005];int list[100005],numoflist;int bsearch(int value){ int l=0,r=numoflist-1,mid; while (l<r) { mid=(l+r)>>1; if (list[mid]>=value) 阅读全文

posted @ 2013-03-28 18:55 Deller 阅读(144) 评论(0) 推荐(0)

PKU POJ 1458 Common Subsequence LCA 最长公共子序列

摘要: View Code #include <iostream>#include <string.h>#include <stdlib.h>#include <algorithm>using namespace std;int LCS(char x[],int l1,char y[],int l2){ int i,j,p,dp[2][1005]; memset(dp[0],0,sizeof(dp[0])); for (j=0,p=1;j<l2;++j) { dp[p][0]=0; for (i=0;i<l1;++i) { ... 阅读全文

posted @ 2013-03-28 16:07 Deller 阅读(161) 评论(0) 推荐(0)

导航