当前位置:网站首页>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 .
边栏推荐
- Meilu biological IPO was terminated: the annual revenue was 385million, and Chen Lin was the actual controller
- [depth first search] Ji suanke: Square
- How does crmeb mall system help marketing?
- Estimate blood pressure according to PPG using spectral spectrum time depth neural network [turn]
- Precautions for binding shortcut keys of QPushButton
- Camel case with Hungarian notation
- Pytorch common loss function
- R语言ggplot2可视化时间序列柱形图:通过双色渐变配色颜色主题可视化时间序列柱形图
- 多线程基础:线程基本概念与线程的创建
- Tongyu Xincai rushes to Shenzhen Stock Exchange: the annual revenue is 947million Zhang Chi and Su Shiguo are the actual controllers
猜你喜欢
ROS自定义消息发布订阅示例
测试行业的小伙伴,有问题可以找我哈。菜鸟一枚~
If you have any problems, you can contact me. A rookie ~
Introduction to the use of SAP Fiori application index tool and SAP Fiori tools
Abstract classes and abstract methods
openmv4 学习笔记1----一键下载、图像处理背景知识、LAB亮度-对比度
Yutai micro rushes to the scientific innovation board: Huawei and Xiaomi fund are shareholders to raise 1.3 billion
同宇新材冲刺深交所:年营收9.47亿 张驰与苏世国为实控人
Airiot IOT platform enables the container industry to build [welding station information monitoring system]
AutoCAD - what is the default lineweight for centerline drawing and CAD? Can I modify it?
随机推荐
三年Android开发,2022疫情期间八家大厂的Android面试经历和真题整理
Noninvasive and cuff free blood pressure measurement for telemedicine [translation]
Unlock 2 live broadcast themes in advance! Today, I will teach you how to complete software package integration Issues 29-30
[matlab] Simulink the input and output variables of the same module cannot have the same name
Multithreading Basics: basic concepts of threads and creation of threads
Interpreting cloud native technology
安装及管理程序
QLabel 跑马灯文字显示
美庐生物IPO被终止:年营收3.85亿 陈林为实控人
Stm32+mfrc522 completes IC card number reading, password modification, data reading and writing
应用使用Druid连接池经常性断链问题分析
The role of applet in industrial Internet
[depth first search] Ji suanke: Square
Hongke shares | plate by plate ar application in Beijing Winter Olympics
监控界的最强王者,没有之一!
Reptiles have a good time. Are you full? These three bottom lines must not be touched!
On AAE
About static type, dynamic type, ID, instancetype
SQL injection Foundation
Openmv4 learning notes 1 --- one click download, background knowledge of image processing, lab brightness contrast