2014年7月31日

poj 2151 Check the difficulty of problems

摘要: dp[i][j][s]表示第i个人,在前j个问题解决了s个问题dp[i][j][s]=dp[i][j-1][s-1]*p[i][j]+dp[i][j-1][s]*(1-p[i][j]); 1 #include 2 #include 3 #include 4 #include 5 #include 6... 阅读全文

posted @ 2014-07-31 23:04 天凉了 阅读(96) 评论(0) 推荐(0) 编辑

cf 148D Bag of mice

摘要: The dragon 选一只老鼠,然后会跑掉一只the princess选一只老鼠,不会跑出另外的老鼠求the princess赢的概率 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #i... 阅读全文

posted @ 2014-07-31 22:21 天凉了 阅读(128) 评论(0) 推荐(0) 编辑

poj 3071 Football

摘要: 题意:有2^n支队伍进行比赛,每行给出这支队伍打败各支队伍的几率,求获胜几率最大的队伍 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 #incl... 阅读全文

posted @ 2014-07-31 22:10 天凉了 阅读(128) 评论(0) 推荐(0) 编辑

sgu 495 Kids and Prizes

摘要: 计算出每个人得到礼物的概率,然后加起来即可 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 double dp[101010]; 7 int main(){ 8 int n,m; 9 while... 阅读全文

posted @ 2014-07-31 21:42 天凉了 阅读(231) 评论(0) 推荐(0) 编辑

hdu 4336 Card Collector

摘要: 有n种卡片,概率分别为p1...pn,p1+...+pn 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 using namespace std;11 #define ... 阅读全文

posted @ 2014-07-31 20:46 天凉了 阅读(117) 评论(0) 推荐(0) 编辑

zoj 3329 One Person Game

摘要: 原文地址:http://www.cnblogs.com/kuangbin/archive/2012/10/03/2710648.html/*ZOJ 3329题意:有三个骰子,分别有k1,k2,k3个面。每次掷骰子,如果三个面分别为a,b,c则分数置0,否则加上三个骰子的分数之和。当分数大于n时结束。... 阅读全文

posted @ 2014-07-31 19:37 天凉了 阅读(157) 评论(0) 推荐(0) 编辑

poj 2096 Collecting Bugs

摘要: 题意:一个新项目里面,有n种bugs,有s 个subcomponents,找出的一个bug属于n个bugs里的某一种的概率为 1/n;找出的一个bug属于m个subcomponentsde里的某一种的概率为 1/m求每种bugs至少找出一个bug,每种subcomponents找出一个bug的次数期... 阅读全文

posted @ 2014-07-31 14:15 天凉了 阅读(216) 评论(0) 推荐(0) 编辑

poj 3744 Scout YYF I

摘要: 题意:有 n个雷,分别在 a[0]...a[n-1],走一步概率为p,走两步概率为1-p,初始位置为1,问安全到达终点的概率。因为位置范围比较大【1, 100000000】,所以可以把 相邻的两个地雷之间的概率用矩阵快速幂计算[ a(i) a(i+1) ] *| 0 1-p |=[ a(i+1) a... 阅读全文

posted @ 2014-07-31 10:47 天凉了 阅读(203) 评论(0) 推荐(0) 编辑

导航