
dp
Davenny
O ever youthful,O ever weeping.
展开
-
CodeForces
Description Let’s introduce the designation , where x is a string, n is a positive integer and operation ” + ” is the string concatenation operation. For example, [abc, 2] = abcabc.We’ll say that stri转载 2017-07-06 09:53:24 · 547 阅读 · 0 评论 -
求最长上升子序列
通常求最长上升子序列的做法是两层for循环,这里从别人那里学会了另一种sao操作~~~#include<bits/stdc++.h>using namespace std;int n;int A[500005];int up[500005];//存储上升的长度int down[500005];//下降的长度int u[500005];//最大化上升子序列int d[500005];//最大化原创 2017-07-09 21:01:23 · 333 阅读 · 0 评论 -
hdu2845之Beans,DP
hdu2845之Beans,DP 2012-12-08 16:12 533人阅读 评论(0) 收藏 举报 版权声明:本文为博主原创文章,未经博主允许不得转载。 Problem Description Bean-eating is an interesting game, everyone owns an M*N matrix, which is filled with different q转载 2016-07-07 21:30:21 · 284 阅读 · 0 评论 -
dp:房间
Description One day, little Vasya found himself in a maze consisting of (n + 1) rooms, numbered from 1 to (n + 1). Initially, Vasya is at the first room and to get out of the maze, he needs to get to原创 2016-07-21 19:01:29 · 482 阅读 · 0 评论 -
概率DP:飞行棋hdu4405
Description Hzz loves aeroplane chess very much. The chess map contains N+1 grids labeled from 0 to N. Hzz starts at grid 0. For each step he throws a dice(a dice have six faces with equal probability原创 2016-07-19 08:46:48 · 451 阅读 · 0 评论 -
区间DP:Brackets
Description We give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence, if s is a regular brackets sequence, then (s) and [s] are re转载 2016-07-09 19:57:58 · 300 阅读 · 0 评论 -
dp: POJ 3046 Ant Counting
Description Bessie was poking around the ant hill one day watching the ants march to and fro while gathering food. She realized that many of the ants were siblings, indistinguishable from one another.原创 2016-07-29 14:29:39 · 369 阅读 · 0 评论 -
dp+java:uva11375
http://acm.hust.edu.cn/vjudge/contest/127206#problem/L 题目大意: 用火柴拼数字,告诉你每一个数字所需要的火柴数,问你用N根可以拼出多少个数字,包括一位及多位,并且不可以有前导零由于题目结果会很大用java大数代码是在已拼好的的数字之后添加新的数字,所以第一个数字不可以为零即i和j不可以同时为零 然后在输出结果的时候,若果N大于等于6加上单原创 2016-08-10 15:38:09 · 264 阅读 · 0 评论 -
hdu 6155 - Subsequence Count 线段树+dp+矩阵
参考的原博客:http://www.cnblogs.com/iRedBean/p/7398272.html #include <bits/stdc++.h>#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1using namespace std;int n,q;const int maxn=1e5+9;const long long mod转载 2017-08-21 11:40:21 · 460 阅读 · 0 评论