http://acm.hdu.edu.cn/showproblem.php?pid=3076 不可思议的题目,总之血量越少胜率越高,所以读取时把两人的血量交换一下 明显每一轮的胜率和负率都是固定的,所以设psc为胜率,pls为负率,peq为平率, 则在每一局中的胜率负率平率可以确定, 而在有结果的一个阶段中的胜率和负率则各是一个无穷级数 psc(new)=1*psc+peq*psc+peq*peq*psc.......=lim(n->正无穷)(1-peq^n)*psc/(1-peq)=psc/(…
///题意: /// A,B掷骰子,对于每一次点数大者胜,平为和,A先胜了m次A赢,B先胜了n次B赢. ///p1表示a赢,p2表示b赢,p=1-p1-p2表示平局 ///a赢得概率 比一次p1 两次p0*p1 三次 p0^2*p1,即A赢的概率为p1+p*p1+p^2*p1+...p^n*p1,n->无穷 ///即a_win=p1/(1-p);b_win=p2/(1-p); ///dp[i][j]表示a赢了j次,b赢了i次的概率 ///dp[i][j]=dp[i-1][j]*b_win+dp[…
ssworld VS DDD Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 1487    Accepted Submission(s): 304 Problem Description One day, sssworld and DDD play games together, but there are some special…
//ssworld VS DDD 两个人有血量值 hp1 , hp2  //两人掷骰子得到每一点的概率已知 //ssword赢的概率 //dp[i][j]  表示有第一个人血量为i.第二个人的血量为j第一个人赢的概率 //第一个人赢,第二个人赢 , 平局的概率为p1 , p2 , p3 //那么有dp[i][j] = p2*dp[i-1][j] + p1*dp[i][j-1] + p3*dp[i][j] //整理可得dp[i][j] = p2/(1-p3)*dp[i-1][j] + p1/(1-…
ATM Mechine 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5781 Description Alice is going to take all her savings out of the ATM(Automatic Teller Machine). Alice forget how many deposit she has, and this strange ATM doesn't support query deposit. T…
wolf5x Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 402    Accepted Submission(s): 248 Special Judge Problem Description There are n grids in a row. The coordinates of grids are numbered fro…
Aeroplane chess Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1503    Accepted Submission(s): 1025 Problem Description Hzz loves aeroplane chess very much. The chess map contains N+1 grids la…
Card Collector Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3407    Accepted Submission(s): 1665Special Judge Problem Description In your childhood, do you crazy for collecting the beautiful…
t组数据 n块黄金 到这里就捡起来 出发点1 到n结束  点+位置>n 重掷一次 dp[i] 代表到这里的概率 dp[i]=(dp[i-1]+dp[i-2]... )/6  如果满6个的话 否则处理一下 然后期望就是 sum+=dp[i]*z[i]; #include <stdio.h> #include<algorithm> #include<math.h> #include<string.h> using namespace std; #defin…
http://acm.split.hdu.edu.cn/showproblem.php?pid=3853 LOOPS Problem Description   Akemi Homura is a Mahou Shoujo (Puella Magi/Magical Girl). Homura wants to help her friend Madoka save the world. But because of the plot of the Boss Incubator, she is t…