当前位置:网站首页>English topic assignment (25)
English topic assignment (25)
2022-07-06 19:03:00 【m0_ sixty-five million seven hundred and eighty-eight thousand 】
The original title is :
So you want to be a 2n-aire?
1000ms 32768K
describe :
The player starts with a prize of $$$1, and is asked a sequence of n questions. For each question, he may
quit and keep his prize.
answer the question. If wrong, he quits with nothing. If correct, the prize is doubled, and he continues with the next question.
After the last question, he quits with his prize. The player wants to maximize his expected prize.
Once each question is asked, the player is able to assess the probability p that he will be able to answer it. For each question, we assume that p is a random variable uniformly distributed over the range t .. 1.
Input :
Input is a number of lines, each with two numbers: an integer 1 ≤ n ≤ 30, and a real 0 ≤ t ≤ 1. Input is terminated by a line containing 0 0. This line should not be processed.
Output :
For each input n and t, print the player's expected prize, if he plays the best strategy. Output should be rounded to three fractional digits.
The sample input :
1 0.5 1 0.3 2 0.6 24 0.25 0 0
Sample output :
1.500 1.357 2.560 230.138
( link :So you want to be a 2n-aire? | JXNUOJ)
translate :
Participants can get $$$1 As a bonus , And be asked n A question . For every question , He can quit or stay for his bonus .
Question answering , If it's wrong , Nothing will happen if you quit ; If you're right , Double the bonus , And he can continue to answer the next question .
After the last question , He can quit with his bonus . This contestant wants to get the most prize .
For every question asked , The contestant can estimate the possibility that he can answer p. For each problem, we assume p It is randomly and evenly distributed in the range t···1.
Input :
There are many lines of input , A row contains two numbers : An integer 1<=n<=30, A real number 0<=t<=1. When a line is entered as 0 0 when , Input termination .
Output :
For each input n and t, Output contestants to give full play to their strength , Expected bonus . Output reserved 3 Decimal place .
边栏推荐
- 上海部分招工市场对新冠阳性康复者拒绝招录
- Xingnuochi technology's IPO was terminated: it was planned to raise 350million yuan, with an annual revenue of 367million yuan
- How to improve website weight
- [depth first search] Ji suanke: Square
- Lucun smart sprint technology innovation board: annual revenue of 400million, proposed to raise 700million
- 深度循环网络长期血压预测【翻译】
- MRO工业品企业采购系统:如何精细化采购协同管理?想要升级的工业品企业必看!
- Penetration test information collection - site architecture and construction
- Execution process of MySQL query request - underlying principle
- Method of accessing mobile phone storage location permission under non root condition
猜你喜欢
Nuc11 cheetah Canyon setting U disk startup
助力安全人才专业素养提升 | 个人能力认证考核第一阶段圆满结束!
Graffiti intelligence is listed on the dual main board in Hong Kong: market value of 11.2 billion Hong Kong, with an annual revenue of 300 million US dollars
Visual Studio Code启动时提示“Code安装似乎损坏。请重新安装。”、标题栏显示“不受支持”信息的解决办法
如何提高网站权重
Binary search tree
Use cpolar to build a business website (1)
用于远程医疗的无创、无袖带血压测量【翻译】
Digital "new" operation and maintenance of energy industry
About NPM install error 1
随机推荐
Word如何显示修改痕迹
AUTOCAD——中心线绘制、CAD默认线宽是多少?可以修改吗?
R语言使用rchisq函数生成符合卡方分布的随机数、使用plot函数可视化符合卡方分布的随机数(Chi Square Distribution)
Qlabel marquee text display
Digital "new" operation and maintenance of energy industry
人体骨骼点检测:自顶向下(部分理论)
R语言dplyr包进行数据分组聚合统计变换(Aggregating transforms)、计算dataframe数据的分组均值(mean)
视频化全链路智能上云?一文详解什么是阿里云视频云「智能媒体生产」
openmv4 学习笔记1----一键下载、图像处理背景知识、LAB亮度-对比度
应用使用Druid连接池经常性断链问题分析
R language ggplot2 visualization: use ggviolin function of ggpubr package to visualize violin diagram
使用map函数、split函数一行键入多个元素
10、 Process management
Installation and management procedures
巨杉数据库首批入选金融信创解决方案!
基于蝴蝶种类识别
Specify flume introduction, installation and configuration
There is a sound prompt when inserting a USB flash disk under win10 system, but the drive letter is not displayed
根据PPG估算血压利用频谱谱-时间深度神经网络【翻】
Describe the process of key exchange