HDU 4438 Hunters(模拟)
2014-03-30 22:23
302 查看
题目链接:HDU 4438 Hunters
模拟。
很简单的题目,两种情况(Alice先选tiger或者Alice先选wolf)算出来比一下大小就行了。
模拟。
很简单的题目,两种情况(Alice先选tiger或者Alice先选wolf)算出来比一下大小就行了。
#include <iostream> #include <iomanip> using namespace std; int t, x, y; double p, q; double tiger, wolf; int main() { cin >> t; while(t--) { cin >> x >> y >> p >> q; tiger = q * (x * p + y * p) + (1.0 - q) * x; wolf = q * y + (1.0 - q) * (x * p + y * p); if(tiger > wolf) { cout << "tiger "; cout << fixed << setprecision(4) << tiger << endl; } else { cout << "wolf " ; cout << fixed << setprecision(4) << wolf << endl; } } return 0; }
相关文章推荐
- HDU-4438 Hunters 期望 水
- HDU-4438-Hunters
- hdu 4438 Hunters
- HDU 4438 Hunters 概率期望 2012 Asia Tianjin Regional Contest
- hdu 4438 Hunters
- hdu 4438 Hunters(数学期望)
- HDU-#4438 Hunters
- hdu 4438 Hunters【数学水题】
- HDU 4438 Hunters
- HDU 4438 Hunters 简单概率
- HDU—— 4438 Hunters
- HDU 4438 Hunters (数学,概率计算)
- HDU 4438 Hunters 区域赛水题
- hdu 2082 找单词(模拟)
- 【HDU 4891 多校联合】The Great Pan【模拟】
- hdu 4891 The Great Pan(模拟)
- hdu 5071 模拟
- hdu 5095 Linearization of the kernel functions in SVM(模拟,分类清楚就行)
- HDU 4891 The Great Pan (模拟)
- HDU 5993 ArcSoft's Office Rearrangement 简单模拟