当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6693:Valentine's Day

Special Judge 特殊评判
题目描述
Oipotato loves his girlfriend very much. Since Valentine's Day is coming, he decides to buy some presents for her.

There are $n$ presents in the shop, and Oipotato can choose to buy some of them. We know that his girlfriend will possibly feel extremely happy if she receives a present. Therefore, if Oipotato gives $k$ presents to his girlfriend, she has $k$ chances to feel extremely happy. However, Oipotato doesn't want his girlfriend to feel extremely happy too many times for the gifts.

Formally, for each present $i$, it has a possibility of $P_i$ to make Oipotato's girlfriend feel extremely happy. Please help Oipotato decide what to buy and maximize the possibility that his girlfriend feels extremely happy for exactly one time.
输入解释
There are multiple test cases. The first line of the input contains an integer $T~(1 \le T \le 100)$, indicating the number of test cases. For each test case:

The first line contains an integer $n~(1 \le n \le 10\ 000)$, indicating the number of possible presents.

The second line contains $n$ decimals $P_i~(0 \le P_i \le 1)$ with exactly six digits after the decimal point, indicating the possibility that Oipotato's girlfriend feels extremely happy when receiving present $i$.

It is guaranteed that the sum of $n$ in all test cases does not exceed $450\,000$.
输出解释
For each test case output one line, indicating the answer. Your answer will be considered correct if and only if the absolute error of your answer is less than $10^{-6}$.
输入样例
2
3
0.100000 0.200000 0.900000
3
0.100000 0.300000 0.800000
输出样例
0.900000000000
0.800000000000
来自杭电HDUOJ的附加信息
Recommend chendu

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6693

最后修改于 2020-10-25T23:33:33+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/2000MS(Java/Others) 524288/524288K(Java/Others)