![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
dp
文章平均质量分 66
coder_coder_coder
默默的程序猿
展开
-
PKU的Bridging Signals
PKU的Bridging Signals 在0(n*logn)的设计上写的很复杂,无意见看到下面这个程序(by CQF) 受到启发了!! 呵呵转CQF大牛的算法:1、建立一个栈stack,清空。{stack[i]表示当前状态下,所有长度为i的子序中最后一个数的最小值}。//这个太漂亮了:cqf是大牛大牛大大牛呀:)2、按先后顺序循环序列的每一个数,用操作3修改当前状态转载 2014-08-03 00:51:26 · 345 阅读 · 0 评论 -
hdu1267最少拦截系统
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1257#include #include using namespace std;const int N=30010;int n,a[N],dp[N];int main(){ while(cin>>n){ for(int i=0;i<n;i++){原创 2014-08-04 00:42:09 · 368 阅读 · 0 评论 -
hdu1087 Super Jumping! Jumping! Jumping!
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1087原创 2014-08-03 23:51:45 · 325 阅读 · 0 评论 -
sgu183 Painting the balls_dp
#include #include #include //F[i, j] = c[j] + min {F[k, i]) ( j - M < k < i}using namespace std;const int N=105;const int inf=0x3fffffff;const int MAXN=10005;int n,m,c[MAXN],dp[N][N];//sgu限内存原创 2014-08-18 23:31:00 · 534 阅读 · 1 评论 -
poj3691DNA repair
#include #include #include #include using namespace std;const int N=1005;const int INF=0x3ffffff;int tot=0,dp[N][N];struct node{ int son[4],fail; bool dan;}trie[N];void init(){ f原创 2014-08-13 01:24:10 · 566 阅读 · 0 评论 -
poj2533Longest Ordered Subsequence LIS(优化)
#include #include #include using namespace std;const int N=1010;const int inf=0x3fffffff;int n,a[N],dp[N];int binary_search(int aim[],int d,int length){ int l=0,r=length,mid; while(l!=原创 2014-08-18 22:58:01 · 460 阅读 · 0 评论