
LIS/LCS
BlackJack_
这个作者很懒,什么都没留下…
展开
-
LIS 求最长上升子序列长度
求最长上升子序列长度 #include #include using namespace std; const int MAXN=5001; int s[MAXN]; int main(int argc, char *argv[]) { int n,i,x,l,r,mid; int top=0; s[0]=-1; sca原创 2017-03-07 08:04:00 · 443 阅读 · 0 评论 -
BZOJ 2423: [HAOI2010]最长公共子序列
2423: [HAOI2010]最长公共子序列 Time Limit: 10 Sec Memory Limit: 128 MB Submit: 1696 Solved: 674 [Submit][Status][Discuss] Description 字符序列的子序列是指从给定字符序列中随意地(不一定连续)去掉若干个字符(可能一个也不去掉)后所形成的字符序列。令给定的字符序列X原创 2017-05-12 13:56:44 · 586 阅读 · 1 评论 -
BZOJ 1046: [HAOI2007]上升序列 LIS
1046: [HAOI2007]上升序列 Time Limit: 10 Sec Memory Limit: 162 MB Submit: 5004 Solved: 1741 [Submit][Status][Discuss] Description 对于一个给定的S={a1,a2,a3,…,an},若有P={ax1,ax2,ax3,…,axm},满足(x1 Input原创 2017-08-20 10:31:32 · 329 阅读 · 0 评论 -
BZOJ 4993: [Usaco2017 Feb]Why Did the Cow Cross the Road II LCS
4993: [Usaco2017 Feb]Why Did the Cow Cross the Road II Time Limit: 10 Sec Memory Limit: 256 MB Submit: 28 Solved: 19 [Submit][Status][Discuss] Description 上下有两个长度为n、位置对应的序列A、B, 其中数的范围均为1~n。若原创 2017-08-21 11:32:51 · 450 阅读 · 0 评论 -
BZOJ 4990: [Usaco2017 Feb]Why Did the Cow Cross the Road II 树状数组优化LCS
4990: [Usaco2017 Feb]Why Did the Cow Cross the Road II Time Limit: 10 Sec Memory Limit: 128 MB Submit: 20 Solved: 9 [Submit][Status][Discuss] Description Farmer John is continuing to ponder t原创 2017-08-22 10:40:32 · 460 阅读 · 0 评论 -
BZOJ 4275: [ONTAK2015]Badania naukowe
4275: [ONTAK2015]Badania naukowe Time Limit: 3 Sec Memory Limit: 256 MB Submit: 163 Solved: 72 [Submit][Status][Discuss] Description 给定三个数字串A,B,C,请找到一个A,B的最长公共子序列,满足C是该子序列的子串。 Input原创 2017-08-30 14:41:07 · 363 阅读 · 0 评论 -
BZOJ 1109: [POI2007]堆积木Klo dp LIS
1109: [POI2007]堆积木KloTime Limit: 10 Sec Memory Limit: 162 MBSubmit: 1143 Solved: 424[Submit][Status][Discuss]Description Mary在她的生日礼物中有一些积木。那些积木都是相同大小的立方体。每个积木上面都有一个数。Mary用他的所有积木垒了一个高塔。妈妈告诉Mary游戏的目的...原创 2018-02-27 19:42:27 · 330 阅读 · 3 评论 -
BZOJ 5157: [Tjoi2014]上升子序列 dp 线段树
和正常的 O(n^2) 上升序列dp一样但要求本质不同所以每当一个数字出现 就要减掉这个数字之前的dp值之后线段树优化一下就行了#include<cmath> #include<ctime> #include<cstdio> #include<cstring> #include<cstdlib> #include<iostream&...原创 2018-02-25 11:23:29 · 453 阅读 · 0 评论