aire专题

杭电1145 so you want to be a 2n-aire?

杭电1145 这道题的意思是给你一元钱,让你连续回答n个问题,每回答对一个问题,钱数翻倍,回答错了,就什么也没有了,已知你回答对没到题的概率在t到1之间均匀分布。求你能获得的最大的钱数期望。       刚看到这道题不明白什么意思,到底求什么期望,后来看了几篇大牛的博客才懂,首先假设有n道题,你已经回答了i道题了,下面我们要确定的是回答第i+1道题是回答还是不回答,那么该如何确定呢?

UVA 10900 So you want to be a 2n-aire?

题意:参考这里点击打开链接 #include<stdio.h>#include<string.h>#include<math.h>#define MAXD 35int N;double T, q[MAXD];void solve(){int i, j, k;double eq, f = 1, quit;f = q[N];for(i = N - 1; i >= 0; i --){q

uva 10090 So you want to be a 2n-aire?

原题: The player starts with a prize of $1, and is asked a sequence of n ques- tions. For each question, he may • quit and keep his prize. • answer the question. If wrong, he quits with nothing.If