摘要:1 #include 2 using namespace std; 3 #define ll long long 4 const ll inf = 1000000000000; 5 const int N =100010; 6 int n,m; 7 double dp[N]; 8 /* 9 有N个礼物,M次选择,每次取的可能是未被选到的礼物 10 (礼物取走把空盒子放回可...
阅读全文
摘要:1 #include 2 using namespace std; 3 int n; 4 double d; 5 double p,l,v,ret,sum; 6 int cnt =1; 7 /* 8 9 村庄A,B之间有若干条河流,每条河流上的船速各自保持不变。告诉河流条数,两个村庄之间的距离 10 以及每条河流的距离A村庄的位置,宽度,船的速度。求A...
阅读全文
摘要:1 #include 2 using namespace std; 3 int n,t; 4 const int N = 1200; 5 double dp[N]; 6 /* 7 甩一个n面的骰子,问每一面都被甩到的需要甩的次数期望是多少。 8 dp[i]:已经甩到i个面了,要达到n个面还需要次数的期望 9 显然dp[n] = 0 10 那么逆序分析:dp[i] :再甩一...
阅读全文
摘要:PockyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2095 Accepted Submission(s): 1133 Problem De
阅读全文
摘要:Alice and Bob are playing a simple game. They line up a row of n identical coins, all with the heads facing down onto the table and the tails upward.
阅读全文
摘要:/* 证明过程如下 :第一种情况:按1到n的顺序上飞机,1会随意选一个,剩下的上去时若与自己序号相同的座位空就坐下去,若被占了就也会随意选一个。求最后一个人坐在应坐位置的概率 */
阅读全文