PAT1011
With the 2010 FIFA World Cup running,
随着2010世界杯的举行
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.
中国足球提供了一种叫TW的游戏
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.
之后每场比赛有三种可能的结果,win,tie,lose
There was an odd assigned to each result. The winner's odd would be the product of the three odds times 65%.
对于每个结果都已一个基数,最后胜利的基数是三个基数的65%
For example, 3 games' odds are given as the following:
W T L
1.1 2.5 1.7
1.2 3.0 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.0*2.5*65%-1)*2 = 37.98 yuans (accurate up to 2 decimal places).
Input
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
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.0 1.6
4.1 1.2 1.1
Sample Output
T T W 37.98
这道题翻译到一半就不想看了,求三个最大值,然后代入公式一算,打印结果,没技术含量不写了。
PAT1011的更多相关文章
- PAT1011:World Cup Betting
1011. World Cup Betting (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Wit ...
- pat1011. World Cup Betting (20)
1011. World Cup Betting (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Wit ...
随机推荐
- hdu_5776_sum(前缀和维护)
题目链接:hdu_5776_sum 题意: 给你一串数,问你是否有一个连续的子序列的和为m的倍数 题解: 维护一个前缀和%m的值,如果前缀和%m的值为0或者有两个前缀和%m的值相同,那么就有一个连续区 ...
- 简单Spring和mybatis整合配置文件
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...
- LR的VG与Control之间的关系,并发的实质
LR的VG与Control之间的关系,经过无数次的实验,搞清楚了现实意义的并发.传说每秒有几百,几千,几万用户并发,基本属于设想状态. 在一秒内处理多少个请求,完全在于服务器处理能力的强弱.这里需要强 ...
- QT插件和服务培训
下载地址:http://files.cnblogs.com/files/senior-engineer/%E6%8F%92%E4%BB%B6%E5%92%8C%E6%9C%8D%E5%8A%A1%E5 ...
- gre tunnel
http://searchenterprisewan.techtarget.com/tip/GRE-tunnel-vs-IPsec-tunnel-What-is-the-difference Enca ...
- Js根据class名替换html标签内容 ,在某标签前后添加内容
function getClass(obj, attr) { var aArray = [];//定义一个新的空数组 var i = 0; var aAll = document.getElement ...
- 实现jsp页面显示用户登录信息,利用session保存。
这是后台代码 这是jsp代码,上面是声明,下面是获得值.
- MYSQL和ORACLE的触发器与存储过程语法差异
整改了一番脚本,遇到了一些两种数据库之间的差异,记录一下: 触发器: 差异 MYSQL ORACLE 说明 创建语句不同 create trigger `AA` BEFORE INSERT on `B ...
- LightOJ 1058 平行四边形的判断定理
题目大意:给你n个点,求这n个点最多能组成多少个平行四边形. 题目思路:这道题卡时间,而且卡内存.你要尽可能的想办法优化. 平行四边形的判定定理: 两组对边分别平行的四边形是平行四边形(定义判定法): ...
- druid-1.0.13 数据库配置文件密码加密
1.cmd 切换到druid目录 我的是C:\tool\apache-tomcat-7.0.67\webapps\projectA\WEB-INF\lib 2.运行命令 java -cp druid ...