QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 256 MB مجموع النقاط: 100

#5046. 月亮

الإحصائيات

设 $S$ 为半径为 $1$ 且球心为 $(0, 0, 0)$ 的球体。设 $a_0, a_1, \dots, a_n$ 为 $S$ 表面上的 $n+1$ 个点。其中 $a_1, \dots, a_n$ 的位置固定,而 $a_0$ 是 $S$ 表面上均匀分布的随机点。若存在一个 $S$ 的半球包含 $a_0, \dots, a_n$(点可以在半球边界上),则记 $f=1$,否则 $f=0$。计算 $f$ 的期望值。

输入格式

第一行包含一个整数 $n$,表示点的数量 ($0 \le n \le 100000$)。

接下来的 $n$ 行中,第 $i$ 行包含三个整数 $x, y, z$,表示点 $a_i = \left(\frac{x}{\sqrt{x^2+y^2+z^2}}, \frac{y}{\sqrt{x^2+y^2+z^2}}, \frac{z}{\sqrt{x^2+y^2+z^2}}\right)$ ($-1000000 \le x, y, z \le 1000000, x^2 + y^2 + z^2 \neq 0$)。

保证 $a_1, \dots, a_n$ 各不相同。

输出格式

输出答案。如果答案的绝对误差或相对误差不超过 $10^{-6}$,则视为正确。

样例

样例输入 1

3
1 0 0
0 1 0
0 0 1

样例输出 1

0.875000000000

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.