当前位置:网站首页>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 .
边栏推荐
- 美庐生物IPO被终止:年营收3.85亿 陈林为实控人
- AIRIOT物联网平台赋能集装箱行业构建【焊接工位信息监控系统】
- Analysis of frequent chain breaks in applications using Druid connection pools
- ROS custom message publishing subscription example
- 根据PPG估算血压利用频谱谱-时间深度神经网络【翻】
- Human bone point detection: top-down (part of the theory)
- Wx applet learning notes day01
- 测试行业的小伙伴,有问题可以找我哈。菜鸟一枚~
- Master Xuan joined hands with sunflower to remotely control enabling cloud rendering and GPU computing services
- R语言ggplot2可视化:使用ggpubr包的ggviolin函数可视化小提琴图
猜你喜欢
Visual Studio Code启动时提示“Code安装似乎损坏。请重新安装。”、标题栏显示“不受支持”信息的解决办法
[depth first search] Ji suanke: Square
From 2022 to 2024, the list of cifar azrieli global scholars was announced, and 18 young scholars joined 6 research projects
应用使用Druid连接池经常性断链问题分析
关于npm install 报错问题 error 1
Meilu biological IPO was terminated: the annual revenue was 385million, and Chen Lin was the actual controller
Pychrm Community Edition calls matplotlib pyplot. Solution of imshow() function image not popping up
Self supervised heterogeneous graph neural network with CO comparative learning
Yutai micro rushes to the scientific innovation board: Huawei and Xiaomi fund are shareholders to raise 1.3 billion
Handwritten online chat system (principle part 1)
随机推荐
上海部分招工市場對新冠陽性康複者拒絕招錄
第五期个人能力认证考核通过名单公布
R语言ggplot2可视化:使用ggpubr包的ggstripchart函数可视化分组点状条带图(dot strip plot)、设置add参数为不同水平点状条带图添加箱图
业务与应用同步发展:应用现代化的策略建议
Stm32+mfrc522 completes IC card number reading, password modification, data reading and writing
深度循环网络长期血压预测【翻译】
应用使用Druid连接池经常性断链问题分析
When visual studio code starts, it prompts "the code installation seems to be corrupt. Please reinstall." Solution to displaying "unsupported" information in the title bar
Analysis of frequent chain breaks in applications using Druid connection pools
五金机电行业供应商智慧管理平台解决方案:优化供应链管理,带动企业业绩增长
44 colleges and universities were selected! Publicity of distributed intelligent computing project list
[depth first search] Ji suanke: find numbers
The dplyr package of R language performs data grouping aggregation statistical transformations and calculates the grouping mean of dataframe data
[Sun Yat sen University] information sharing of postgraduate entrance examination and re examination
关于静态类型、动态类型、id、instancetype
Stm32+hc05 serial port Bluetooth design simple Bluetooth speaker
R language ggplot2 visualization: use the ggstripchart function of ggpubr package to visualize the grouped dot strip plot, and set the add parameter to add box plots for different levels of dot strip
From 2022 to 2024, the list of cifar azrieli global scholars was announced, and 18 young scholars joined 6 research projects
一种用于夜间和无袖测量血压手臂可穿戴设备【翻译】
MRO工业品企业采购系统:如何精细化采购协同管理?想要升级的工业品企业必看!