PAT 甲级 1011 World Cup Betting(20 分)

PAT练习题(甲级) 1011 World Cup Betting (20分)(Java实现) PAT练习题 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. Sim 阅读详情

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.31yuans (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
# include <iostream>
# include <algorithm>
using namespace std;

int main(){
//	freopen("C:\\1.txt", "r", stdin);
	char ch[4] = {'W', 'T', 'L'};
	double a[3][3], sum = 0.65;
	for(int i = 0; i < 3; i++){
		int index = 0, max = 0;
		for(int j = 0; j < 3; j++){
			cin >> a[i][j];
			if(a[i][j] > max){
				max = a[i][j];
				index = j;
			}
		}
		printf("%c ", ch[index]);
		sum *= a[i][index];
	}
	printf("%.2lf", (sum -1) * 2);
	return 0;
} 

 

GK2302量产工具下载方法,GK2302开卡教程,GK2301LT怎么开卡方法,附GK2302开卡工具,GK2301LT量产软件下载 ​每种量产软件的操作流程可能略有不同,因此必须按照要求操作。为确保安全,建议使用量产部落网下载的原版量产开卡软件。 阅读详情

相关推荐

5G R18标准:AI/ML如何重塑空口优化与网络架构

人工智能与机器学习正逐步成为通信网络优化的核心技术。其核心原理在于通过数据驱动模型,从海量网络数据中学习信道变化、用户行为等统计规律,替代传统的基于固定规则的优化方法。这一技术范式能显著提升网络性能与效率,尤其在空口资源管理、干扰协调和能耗控制等场景中价值突出。在5G Advanced(R18)标准化框架下,AI/ML被系统性地引入空口设计,聚焦于信道状态信息反馈增强、波束管理与预测等关键用例。通过定义网络侧AI、终端侧AI及联合学习的标准化接口与流程,R18旨在实现跨厂商设备的智能协同,推动无线网络向自适

weixin_35671843的博客 244

PAT:A1011 World Cup Betting (20 分)

PAT:A1011 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 ...

Ecloss 610

数字IC后端实战:OCC电路时钟树综合的5个关键技巧(附Synopsys工具配置)

本文深入探讨了数字IC后端设计中OCC电路时钟树综合的实战技巧。针对工具自动平衡导致的绕线拥塞和时序问题,文章提出了分段处理的核心思路,并详细阐述了通过物理隔离、分段长树策略以及Synopsys工具链(如ICC2、PrimeTime)的精准配置来优化function clk与occ clk路径的关键方法,旨在提升时序收敛性和可制造性。

jwt8token的博客 858

PAT乙级 1023 组个最小数

#include<iostream> #include<string> #include<map> #include<algorithm> #include<bits/stdc++.h> using namespace std; int main(void){ int n; vector<int> vec; for(int i=0; i<10; i++) { cin>&g.

邹九的个人博客 570

abap中使用Screen painter为普通屏幕创建单选按钮组radiobutton组的过程

选择屏幕中,创建radiobutton组直接使用代码实现,如下所示 SELECTION-SCREEN BEGIN OF BLOCK BK1 WITH FRAME TITLE TEXT-001. PARAMETERS R1 RADIOBUTTON GROUP GR1. PARAMETERS R2 RADIOBUTTON GROUP GR1. PARAMETERS R3 RADIOBUTTON GR

charliefromkansas的博客 8302

多边形裁剪算法

多边形裁剪算法 刚参加工作就跟多边形刚上了,对于多边形的裁剪做一些简单的总结。 多边形裁剪主要有四种算法 Greiner-Hormann裁剪算法 Sutherland-Hodgman算法 Vatti裁剪算法 Weiler-Atherton裁剪算法 作为一名想要成为优秀算法工程师的程序员,我们不能只会使用,而不知道其原理,倘若如此,我们无法做到应用于本身业务上的定制化的修改。 Greiner–H...

papalqi 6729

PAT甲级 1011 World Cup Betting (20 分) 题解

\quad这个题难在题意理解上面,说白了就是给你九个数,三个一组,找出一组中最大的数字并记录下这个数所属类别(W,T,L)。一行是一组。最后把每个组最大的数乘起来,乘0.65,再减去1,最后将所得结果乘2输出。即(max1∗max2∗max3∗0.65−1)∗2(max_1*max_2*max_3*0.65-1)*2(max1​∗max2​∗max3​∗0.65−1)∗2。 #include &...

qq_40438165的博客 1664

PSI5协议技术文档与驱动开发指南

• 供电与数据复用:ECU通过双绞线为传感器提供稳压(典型值5V-11V),同时检测线路电流变化实现数据传输。• 同步信号:ECU发送3.5V电压脉冲(上升沿触发传感器响应),用于时序同步。• 安全气囊:PSI5-P模式实现多碰撞传感器同步采样(响应时间<10ms)• CRC-3(3位):ASIL-B以上功能安全要求(如动力总成传感器)• 奇偶校验(1位):适用于低安全等级场景(如PSI5-P10P模式)• 典型应用:PSI5-P(并行总线)、PSI5-U(通用总线)

u012733413的博客 2870

PAT甲级查找元素1011 World Cup Betting

昨天看了一本书,《你的灯亮着吗》,用一些小例子讲述各种情况下问题解决者面对问题做出的反应,很薄,不到两个小时就看完了, 会反复读。里面有一句话:当你以为你认为问题很好地解决了,其实并没有。正如下面这道题很简单,但显然有更简单的方法。 With the 2010 FIFA World Cup running, football fans the world over were becoming i...

qq_33819508的博客 266

Briefings in Bioinformatics投稿经验分享

Briefings in Bioinformatics投稿经验分享

LiRongLu_的博客 3340

AMDGPU驱动中Doorbell与Event机制简要对比

摘要:AMDGpu驱动中,Doorbell和Event是两种异步通知机制。Doorbell是CPU→GPU的单向硬件通知,通过写MMIO寄存器触发GPU拉取任务,延迟低且无需内核介入,适用于队列任务提交。Event是GPU→CPU的双向同步通知,基于中断和内核事件对象,支持阻塞等待,用于任务完成或异常上报。核心区别在于方向、用途和实现方式:Doorbell侧重任务触发,Event侧重状态反馈。两者配合实现高效的任务下发与完成通知流程。

图形/计算GPU的驱动与虚拟化技术分享园地 1860

PAT 甲级 1011 World Cup Betting

PAT 甲级 1011 World Cup Betting 简单模拟 #include<bits/stdc++.h> using namespace std; int main() { #ifdef LOCAL freopen("input.txt", "r", stdin);//freopen("output.txt", "w", stdout); #endif double W, T, L, ans = 1; for (int i = 0; i < 3; ++i

桂圆儿的仓库 198

linux平台Modbus TCP测试

【代码】linux平台Modbus TCP测试。

无线互联&网络介绍 818

[PAT 甲级] 1011 World Cup Betting (20 分)

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...

cp0328的博客 3314

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

PAT甲级1011 World Cup Betting (20分)

PAT甲级1011 World Cup Betting (20分) 题目: 题目分析:很简单,n2复杂度 AC代码: #include <cstdio> using namespace std; int main() { char c[3] = {'W','T','L'}; double ans = 1.0; for(int i = 0; i < 3; i...

weixin_43795683的博客 249

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

PAT甲级 1011 World Cup Betting (20分)

1011 World Cup Betting (20分) 题目链接:PAT A 1011 思路分析:嗯…这道题就很迷,我不知道它那个公式是怎么来的,开始还以为是按照题意,不同的数据对应不同的公式,后来才发现所有数据都是那个公式,但是我不太理解(原谅笨笨的我,大家有明白的别忘了告诉我啊~),但是不影响做题。就是找每行中赔率最大的输出它所对应的的字母,然后用那个公式计算收益就可以了。 AC代码: #...

weixin_43684054的博客 425

PAT甲级 1011 World Cup Betting (20 分)

@[TOC](PAT甲级 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,

weixin_44585441的博客 232

【PAT甲级】1011 World Cup Betting (20 分)

1011 World Cup Betting 题目描述 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 Cu...

初见还是重逢的博客 275

PAT甲级 - 1011 World Cup Betting (20 分)

题目链接:PAT甲级 - 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 ...

197

【PAT甲级】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

memcpy0的博客 383

1011 World Cup Betting (20 分) PAT 甲级

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...

小渣渣的博客 307

PAT甲级真题——1011 World Cup Betting (20 分)

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 ...

WangXin Programmer 438

PAT甲级——1011 World Cup Betting (20分)

看懂题目后就是简单模拟即可,因为数字很小,排序上也不用花心思,简单三个数排序即可; 1011World Cup Betting(20分) With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from...

沉迷单车的追风少年 543

PAT甲级-1011 World Cup Betting (20分)

点击链接PAT甲级-AC全解汇总 题目: 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 troph...

卷子的博客 387

C++ Pat甲级1011 World Cup Betting (20 分)

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...

Scarlett 255
上一篇: PAT 甲级 1010 Radix(25 分)
下一篇: PAT 甲级 1016 Phone Bills(25 分)
UKnowNothing_
博客等级 码龄9年 58粉丝 106原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值