1011 World Cup Betting (20 分)
With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Similarly, football betting fans were putting their money where their mouths were, by laying all manner of World Cup bets.
Chinese Football Lottery provided a "Triple Winning" game. The rule of winning was simple: first select any three of the games. Then for each selected game, bet on one of the three possible results -- namely W
for win, T
for tie, and L
for lose. There was an odd assigned to each result. The winner's odd would be the product of the three odds times 65%.
For example, 3 games' odds are given as the following:
W T L
1.1 2.5 1.7
1.2 3.1 1.6
4.1 1.2 1.1
To obtain the maximum profit, one must buy W
for the 3rd game, T
for the 2nd game, and T
for the 1st game. If each bet takes 2 yuans, then the maximum profit would be (4.1×3.1×2.5×65%−1)×2=39.31 yuans (accurate up to 2 decimal places).
Input Specification:
Each input file contains one test case. Each case contains the betting information of 3 games. Each game occupies a line with three distinct odds corresponding to W
, T
and L
.
Output Specification:
For each test case, print in one line the best bet of each game, and the maximum profit accurate up to 2 decimal places. The characters and the number must be separated by one space.
Sample Input:
1.1 2.5 1.7
1.2 3.1 1.6
4.1 1.2 1.1
Sample Output:
T T W 39.31
分析:大水题。。。
/** * Copyright(c) * All rights reserved. * Author : Mered1th * Date : 2019-02-23-22.59.16 * Description : A1011 */ #include<cstdio> #include<cstring> #include<iostream> #include<cmath> #include<algorithm> #include<string> #include<unordered_set> #include<map> #include<vector> #include<set> using namespace std; int main(){ #ifdef ONLINE_JUDGE #else freopen("1.txt", "r", stdin); #endif double a,ans=1.0; int idx; ]={'W','T','L'}; ;i<;i++){ double temp=-1.0; ;j<;j++){ scanf("%lf",&a); if(temp<a){ idx=j; temp=a; } } ans*=temp; printf("%c ",st[idx]); } printf()*); ; }
1011 World Cup Betting (20 分)的更多相关文章
- PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) 凌宸1642
PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) 凌宸1642 题目描述: With the 2010 FIFA World Cu ...
- PAT Advanced 1011 World Cup Betting (20 分)
With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excite ...
- PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) (找最值)
With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excite ...
- 1011 World Cup Betting (20 分)
With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excite ...
- PAT 1011 World Cup Betting (20分) 比较大小难度级别
题目 With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly exc ...
- 【PAT甲级】1011 World Cup Betting (20 分)
题意: 给出三组小数,每组三个,分别代表一场比赛下注一块钱胜平负的赔率.输出投注的方案并计算投注两块钱期望收获.(赔率相乘后乘上0.65再减去本金2块钱) AAAAAccepted code: #in ...
- PAT 甲级 1011 World Cup Betting (20)(20 分)
1011 World Cup Betting (20)(20 分)提问 With the 2010 FIFA World Cup running, football fans the world ov ...
- PAT 甲级 1011 World Cup Betting (20)(20 分)(水题,不用特别在乎精度)
1011 World Cup Betting (20)(20 分) With the 2010 FIFA World Cup running, football fans the world over ...
- PAT 甲级 1011 World Cup Betting (20)(代码+思路)
1011 World Cup Betting (20)(20 分) With the 2010 FIFA World Cup running, football fans the world over ...
- PAT甲 1011. World Cup Betting (20) 2016-09-09 23:06 18人阅读 评论(0) 收藏
1011. World Cup Betting (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Wit ...
随机推荐
- 玩转X-CTR100 l STM32F4 l DRV8825 A4988 步进电机控制
我造轮子,你造车,创客一起造起来!塔克创新资讯[塔克社区 www.xtark.cn ][塔克博客 www.cnblogs.com/xtark/ ] 本文介绍X-CTR100控制器控制步进电机 ...
- MyEclipse持续性开发教程:用JPA和Spring管理数据(一)
MyEclipse开年钜惠 在线购买低至75折!立即开抢>> [MyEclipse最新版下载] 本教程介绍了MyEclipse中的一些基于JPA / Spring的功能.有关设置JPA项目 ...
- 写在连载之前——DIY微型操作系统篇
这个博客开了这么久都没写过什么东西.可能是因为我想写的东西在网上都能找得到,所以自己也懒得去写了. 但是这次当我在看<30天自制操作系统>这本书的时候发现,如果不用作者原版的光盘软件,要自 ...
- Linux tomcat自动启动
1.编辑/etc/rc.d/rc.local 添加环境变量 例如: JAVA_HOME=/usr/local/java/JRE_HOME=/usr/local/java/jreCLASS_PATH=. ...
- java并发编程之三--CyclicBarrier的使用
CyclicBarrier 允许一组线程全部等待彼此达到共同屏障点的同步辅助. 循环阻塞在涉及固定大小的线程方的程序中很有用,这些线程必须偶尔等待彼此. 屏障被称为循环 ,因为它可以在等待的线程被释放 ...
- Dll封装dll,并且调用该封装的dll
按照图1,2,3创建一个默认的(可以导出符号的dll项目) 默认创建的,很好地给我们说明了怎么导出 变量,导出函数,导出类 注意这里加入你要导出的函数的声明 WIN32PROJECT1_API int ...
- P1001 第K极值
P1001 第K极值 时间: 1000ms / 空间: 131072KiB / Java类名: Main 背景 成成第一次模拟赛 第一道 描述 给定一个长度为N(0<n<=10000)的序 ...
- 人脸对齐matlab实现-FaceAlignment 3000fps
前言 最近研读了孙剑团队的Face Alignment at 3000fps via Regressing Local Binary Features这篇paper,基于matlab进行实现. 实现原 ...
- TP框架连接mongodb报错及解决办法
mongodb版本3.4.7 1.认证错误:Failed to connect to: localhost:27017: Authentication failed on database 'test ...
- ITelephony.aidl
在src下先建立包名为com.android.internal.telephony(右键src > new > package,create package-info.java打钩),然后 ...