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.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
#include<stdio.h>
int main(){
double w, t, l;
double maxProfit = 1;
int i;
for(i = 0; i < 3; i++){
scanf("%lf%lf%lf", &w,&t,&l);
if(w > t && w >l)
{
printf("W ");
maxProfit *= w;
}
else if(t>l){
printf("T ");
maxProfit *= t;
}
else {
printf("L ");
maxProfit *= l;
}
}
printf("%.2f\n",(maxProfit*0.65-1)*2);
//printf("%.2f\n",(maxProfit*0.65-1)*2 +0.005);
return 0;
}
NOTES:
感觉这道题目有点问题,例子是错的,
分享到:
相关推荐
1.1 2.5 1.7 1.2 3.1 1.6 4.1 1.2 1.1
11. World Cup Betting (20) World Cup Betting是一个基本的算法设计题,要求考生编写一个程序来模拟世界杯赌博游戏。该题目考察了考生的算法设计能力和数据结构设计能力。 知识点: * 算法设计 * 数据结构设计 *...
football_betting.zip
Profitable Betting Systems for Horseracing
资源分类:Python库 所属语言:Python 资源全名:betting_models-0.1.3-py3-none-any.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
### 深度网络训练无需设定学习率:Coin Betting 算法的应用 #### 引言 近年来,深度学习在众多领域展现出了巨大的成功,并吸引了来自不同研究领域的广泛关注。随着深度学习方法的发展,一系列编程框架(例如 Caffe...
NFL_Betting_Data
world Blockchain projects using Ethereum. With interesting real-world projects, you will know learn how to write smart contracts which run exactly as programmed without any chance of fraud, censorship...
《永远的Trackmania程序——Betting Forever开源解析》 在IT行业中,开源软件以其透明、自由和协作的优势,为开发者提供了无限的创新空间。今天我们要探讨的是一款名为"Betting Forever"的开源插件,它是专门为As...
git clone cd betting-app 运行npm start 在没有 Node.js 和 NPM 的情况下运行 git clone cd betting-app/app 单击 index.html 并使用任何浏览器打开 当这是第一次时,此命令将在启动 Web 服务器之前安装所需的...
以太坊坚实度-React投注 以太坊坚实度--React-Betting-App.git
world Blockchain projects using Ethereum. With interesting real-world projects, you will know learn how to write smart contracts which run exactly as programmed without any chance of fraud, censorship...
量化研究新思维(十五):20_for_Twenty,AQR_20周年经典文献摘要 本篇报告总结了AQR公司20周年经典文献的摘要,涵盖了20篇经典研究论文的要点,涵盖了量化投资、风险管理、资产配置等多个方面的知识点。 量化研究...
cs_betting_assistant
NFL_Betting_Data
Betting_WebApplication:投注WebApp
betting 使用 React 和 Redux 制作的竞猜游戏,主题为2018年世界杯,支持 PC 、移动端和微信。不需服务器支持,所有游戏逻辑均在前端完成,。 调试源码 $ apt-get install nodejs npm $ npm install $ npm run watch...
在现代体育娱乐中,幻想体育已经成为了一种流行的消遣方式,而"Fantasy Betting"正是这一领域的代表。它结合了体育知识、策略规划以及数据分析,使得参与者能够在虚拟环境中构建自己的“梦幻球队”,并根据实际比赛...