QOJ.ac

QOJ

Límite de tiempo: 2 s Límite de memoria: 256 MB Puntuación total: 100

#5046. 月亮

Estadísticas

設 $S$ 為半徑為 $1$ 且中心位於 $(0, 0, 0)$ 的球體。設 $a_0, a_1, \dots, a_n$ 為球體 $S$ 表面上的 $n+1$ 個點。其中 $a_1, \dots, a_n$ 的位置是固定的,而 $a_0$ 的位置是在 $S$ 表面上均勻分佈的隨機點。設 $f$ 為一個隨機變數,若存在一個 $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.