hdu 4438 Hunters(数学期望)
2014-10-27 11:38
423 查看
水题。
代码:
代码:
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <vector> using namespace std; #define LL long long #define eps 1e-6 double X,Y,P,Q; int main(){ int T; cin>>T; while(T--){ scanf("%lf%lf%lf%lf",&X,&Y,&P,&Q); double t1=(X+Y)*P*Q+X*(1-Q); double t2=(X+Y)*P*(1-Q)+Y*Q; bool flag=0; double res; if(t1>t2-eps){ flag=0; res=t1; } else { flag=1; res=t2; } if(flag)cout<<"wolf "; else cout<<"tiger "; printf("%.4f\n",res); } return 0; }
相关文章推荐
- hdu 4438 Hunters【数学水题】
- HDU 4438 概率 多个情况下的数学期望
- HDU 4438 Hunters 概率期望 2012 Asia Tianjin Regional Contest
- HDU-4438 Hunters 期望 水
- HDU 4438 Hunters (数学,概率计算)
- HDU 4438 Hunters(模拟)
- HDU 3232 Crossing Rivers (数学期望)
- HDU 4586 Play the dice (数学期望)
- HDU 4438 Hunters 简单概率
- hdu 5570(数学期望)
- hdu 4562 Dice 求期望 推数学公式 (2013多校联合)
- Play the Dice hdu 4586 数学期望的问题
- HDU 4035 Maze(数学期望)
- hdu 4438 Hunters
- UVa 12230 && HDU 3232 Crossing Rivers (数学期望水题)
- HDU 4438 Hunters 区域赛水题
- HDU 5159 Card(数学期望)
- 借助树的概率dp(期望)+数学-好题-hdu-4035-Maze
- hdu 4438 Hunters
- hdu 5723 最小生成树+数学期望 难度:一般