hdu 4438 推公式求概率水题
2015-03-07 10:50
253 查看
水死了,秒切的题....
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> using namespace std; typedef long long LL; int t; LL x,y; double p,q; double ans1,ans2; int main ( ) { scanf ( "%d" , &t ); while ( t-- ) { scanf ( "%lld%lld" , &x , &y ); scanf ( "%lf%lf" , &p , &q ); ans1 = q*p*(x+y) + (1-q)*x; ans2 = q*y + (1-q)*p*(x+y); if ( ans1 > ans2 ) printf ( "tiger %.4lf\n" , ans1 ); else printf ( "wolf %.4lf\n" , ans2 ); } }
相关文章推荐
- hdu 4762 Cut the Cake概率公式
- HDU 4586 Play the dice(概率题,推公式)
- hdu 4336 全期望公式+状态压缩+概率dp
- HDU 4254 A Famous Game (概率&组合数学公式)
- HDU 4438 概率 多个情况下的数学期望
- HDU-4035-概率dp-期望-公式化简
- hdu 4438 Hunters【数学水题】
- HDU 4438 Hunters 简单概率
- HDU 4043 Eliminate Witches! (求概率推公式 + 大数)
- hdu 4576 Robot (概率水题)
- HDU 4438 Hunters 概率期望 2012 Asia Tianjin Regional Contest
- HDU 2086 A1 = ? (找规律推导公式 + 水题)(Java版)
- ACM/ICPC 2012 天津 - HDU 4438 - 算概率
- HDU 4405 Aeroplane chess(全期望公式-概率dp)
- hdu 4652 经典概率题+公式推导
- hdu 2114(Calculate S(n))(连续的三次方求和公式,水题)
- HDU 4586 Play the Dice (数学,概率,等比公式,极限)
- HDU 5245 Joyful 经典概率题目推公式
- HDU 3853 LOOPS (概率DP水题)
- HDU 3076 ssworld VS DDD DP 概率水题