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_1115_Lifting the Stone(求多边形重心)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1115 题意:给你N个点围成的一个多边形,让你求这个多边形的重心. 题解: 将多边形划分为若干个三角形. ...
- SQL SERVER与C#的数据类型对应表
序号 类别 SQLServer C Sharp 备注 1 整数 bit Boolean True转换为1False转换为0 2 tinyint Byte C Sharp 数据类型都位于System命名 ...
- ecshop后台管理显示扩展分类
ecshop 后台商品列表默认只显示分类下的商品,而不显示扩展分类中的商品,以下是我个人给出的解决方法: 打开admin/includes/lib_goods.php 第839行左右的位置 可以看到如 ...
- 浅谈 qmake 之 shadow build
shadow build shadow build 是什么东西?就是将源码路径和构建路径分开(也就是生成的makefile文件和其他产物都不放到源码路径),以此来保证源码路径的清洁. 这不是qmake ...
- MFC下对串口的操作以及定时器的调用
最近研究了一下MFC下对串口的操作,测试了一下对设备的读写. 1.打开串口 GetDlgItem(IDC_BUTTON_OPEN)->EnableWindow(FALSE); m_hComm = ...
- SQL 查询时间段内的时间
declare @dt1 as datetime declare @dt2 as datetime set @dt1 = '2008-01-01' set @dt2 = '2009-01-01' ;w ...
- redis学习一
一.简介: 在过去的几年中,NoSQL数据库一度成为高并发.海量数据存储解决方案的代名词,与之相应的产品也呈现出雨后春笋般的生机.然而在众多产品中能够脱颖而出的却屈指可数,如Redis.MongoDB ...
- zk reconnect
http://blog.csdn.net/hengyunabc/article/details/41450003 http://blog.csdn.net/hengyunabc/article/det ...
- ASP.NET中使用Server.Transfer()方法在页间传值 实例
以下代码在VS2008中测试通过 <%@ Page Language="C#" AutoEventWireup="true" CodeFile=" ...
- innerHTML,innerText,outerHTML,outerText,value浅析
首先是一个例子: <div id= "aa">0<br/>0<span>11</span>22</div><inp ...