QOJ.ac

QOJ

実行時間制限: 3 s メモリ制限: 256 MB 満点: 100

#375. 区间估计

統計

我们正在按如下方式生成若干个随机浮点数:首先选取一个随机数 $r$,它是 $0$ 到 $1000$ 之间的一个均匀分布浮点数。然后,我们选取 $n$ 个在 $0$ 到 $r$ 之间均匀分布的独立随机浮点数。

给定这 $n$ 个数,你能猜出 $r$ 是多少吗?

当然,你不需要猜得完全精确。请参阅输出格式以了解所需的精度。

输入格式

输入文件的第一行包含一个整数 $t$,表示测试用例的数量,总数为十万:$t = 10^5$。接下来的 $t$ 行,每行包含一个测试用例。每个测试用例包含一个整数 $n$ ($5 \le n \le 10$),随后是 $n$ 个根据题目描述生成的浮点数,并保留小数点后 3 位。

输出格式

输出文件应包含 $t$ 行。每一行应为一个浮点数,即你对相应测试用例中 $r$ 的猜测值。如果所有十万个测试用例中,你的猜测值与正确答案之间的平均差值(差值的绝对值)不超过 $44$,则你的答案将被视为正确。

样例

样例输入 1

5
10 14.567 213.932 59.735 92.798 94.233 2.682 94.918 37.214 86.303 13.241
5 86.570 120.219 46.774 182.909 186.631
7 332.938 205.974 309.560 385.298 120.209 401.062 420.374
6 251.248 595.136 248.930 795.932 499.233 421.866
6 626.649 335.461 77.257 386.181 395.272 322.389

样例输出 1

218.55855928539492
222.16512101541008
594.4831558089593
871.3578049742099
638.185410820347

说明

本题共有 10 个测试点。请注意,第一个测试点比样例输入更大,因为它包含 $10^5$ 个测试用例。你可以从 http://forest.acm.petrsu.ru/tests/estimate.in 下载第一个测试点,并从 http://forest.acm.petrsu.ru/tests/estimate.ans 下载用于生成它的 $r$ 值。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.