
DP
文章平均质量分 66
CCSU_Seth
这个作者很懒,什么都没留下…
展开
-
hdu 2955(Robberies)
背包变种 dp[j]表示不被抓的概率#include#include#define maxn 109#includeusing namespace std;int money[maxn];float caught[maxn],dp[maxn*maxn];int main(){ int T,banks; float limits; scanf("%d",&原创 2013-07-13 12:09:27 · 437 阅读 · 0 评论 -
01背包
http://acm.hdu.edu.cn/showproblem.php?pid=3466#include#include#include#includeusing namespace std;struct item{ int p,q,v; bool operator < (const item it ) const{ return q-p < it.q-it.转载 2013-07-13 12:13:06 · 412 阅读 · 0 评论 -
POJ 2533 求最长上升子序列长度 非DP 实现
#include#include#define maxn 1001using namespace std;int stack[maxn],N;int main(){ scanf("%d",&N); int top=0; stack[0]=-1; for(int i=0;i<N;i++) { int temp;转载 2013-07-16 11:00:11 · 458 阅读 · 0 评论 -
POJ 2533 最长上升子序列长度的求解 DP实现
#include#include#define maxn 1001using namespace std;int N;//数据个数int a[maxn];//储存数据int dp[maxn];//dp[i]表示以i结束的最长上升子序列的最大长度 初始为1int main(){ while(~scanf("%d",&N)) { for(int i=1原创 2013-07-16 10:57:54 · 497 阅读 · 0 评论