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$ の表面上の一様ランダムな点である。$a_0, \dots, a_n$ をすべて含む(境界上にあってもよい)$S$ の半球が存在する場合に $f=1$、そうでない場合に $f=0$ とする。$f$ の期待値を求めよ。

入力

1行目に点の数を示す整数 $n$ ($0 \le n \le 100000$) が与えられる。 続く $n$ 行の各行には、点 $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)$ を表す3つの整数 $x, y, z$ が与えられる ($-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.