标签:size closed int mil solution 之间 print color efi
1 #include<cstdio> 2 #include<cstring> 3 #include<iostream> 4 #define dd double 5 using namespace std; 6 7 int R,B,now; 8 dd f[2][5066]; 9 10 int main(){ 11 12 scanf("%d%d",&R,&B); 13 14 now=0; 15 dd temp; 16 for(int i=1;i<=R;++i) 17 { 18 now^=1; 19 f[now][0]=i; 20 for(int j=1;j<=B;++j) 21 { 22 temp=(f[now][j-1]-1)*(dd)(j)/(dd)(i+j)+(f[now^1][j]+1)*(dd)(i)/(dd)(i+j); 23 f[now][j]=temp>0?temp:0; 24 } 25 } 26 printf("%.6lf",f[now][B]-0.0000005); 27 28 //while(1); 29 }
标签:size closed int mil solution 之间 print color efi
原文地址:http://www.cnblogs.com/A-LEAF/p/7423442.html