摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=2955思路:裸的01背包已知被抓的概率,因为不是相互独立的,一次被抓就不用讨论了,所以我们讨论不被抓的最大概率。#include #include #include #include #include using namespace std;double dp[10010],P,p[110];int money[110];int main(){ int t; scanf("%d",&t); while(t--) { int n; scanf("%lf%... 阅读全文
posted @ 2013-07-28 00:46 over_flow 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 题目:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=503思路:裸的01背包#include #include #include #include #include using namespace std;#define maxn 50010int dp[maxn];int coin[110];int main(){ int t; scanf("%d",&t); while(t--) { int n; 阅读全文
posted @ 2013-07-28 00:21 over_flow 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题目:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=8&page=show_problem&problem=565思路:裸的01背包,输出路径,用一维数组标记的#include #include #include #include #include #include using namespace std;int minute[25];int dp[10010];int cnt[10010];int main(){ int n,m; stacks; wh 阅读全文
posted @ 2013-07-28 00:03 over_flow 阅读(126) 评论(0) 推荐(0) 编辑