当前位置:网站首页>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 .
边栏推荐
- Stm32+esp8266+mqtt protocol connects onenet IOT platform
- Jdbc driver, c3p0, druid and jdbctemplate dependent jar packages
- 美庐生物IPO被终止:年营收3.85亿 陈林为实控人
- Jushan database was among the first batch of financial information innovation solutions!
- 关于静态类型、动态类型、id、instancetype
- Crawling data encounters single point login problem
- 巨杉数据库首批入选金融信创解决方案!
- 上海部分招工市場對新冠陽性康複者拒絕招錄
- 抽象类与抽象方法
- 裕太微冲刺科创板:拟募资13亿 华为与小米基金是股东
猜你喜欢

Handwritten online chat system (principle part 1)

The role of applet in industrial Internet

Mathematics in machine learning -- common probability distribution (XIII): Logistic Distribution

Method of accessing mobile phone storage location permission under non root condition

ROS custom message publishing subscription example

How are you in the first half of the year occupied by the epidemic| Mid 2022 summary

应用使用Druid连接池经常性断链问题分析

基于ppg和fft神经网络的光学血压估计【翻译】

抽象类与抽象方法
![[Sun Yat sen University] information sharing of postgraduate entrance examination and re examination](/img/a8/41e62a7a8d0a2e901e06c751c30291.jpg)
[Sun Yat sen University] information sharing of postgraduate entrance examination and re examination
随机推荐
Some recruitment markets in Shanghai refuse to recruit patients with covid-19 positive
美庐生物IPO被终止:年营收3.85亿 陈林为实控人
Method of accessing mobile phone storage location permission under non root condition
三年Android开发,2022疫情期间八家大厂的Android面试经历和真题整理
青龙面板最近的库
Crawling data encounters single point login problem
R language uses DT function to generate t-distribution density function data and plot function to visualize t-distribution density function data
Use cpolar to build a business website (1)
Some understandings of tree LSTM and DGL code implementation
Meilu biological IPO was terminated: the annual revenue was 385million, and Chen Lin was the actual controller
能源行业的数字化“新”运维
五金机电行业智能供应链管理系统解决方案:数智化供应链为传统产业“造新血”
Jdbc driver, c3p0, druid and jdbctemplate dependent jar packages
爬虫玩得好,牢饭吃到饱?这3条底线千万不能碰!
QLabel 跑马灯文字显示
C#/VB. Net to add text / image watermarks to PDF documents
业务与应用同步发展:应用现代化的策略建议
[depth first search] Ji suanke: a joke of replacement
Reptiles have a good time. Are you full? These three bottom lines must not be touched!
helm部署etcd集群