問題一覧 > 通常問題

No.605 Sphere Caught in Between

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-6}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 113
作問者 : 👑 tails / テスター : はむこ
お気に入りにしたユーザー ProblemId : 1412 / 自分の提出
問題文最終更新日: 2026-06-26 10:07:02
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Advent Calendar Contest 2017 (順位表) の他の問題:

Problem Statement

There is a sphere \(S : x^2+y^2+z^2=1 \) of radius \(1\) centered at the origin.
There are also two planes \( P_1 : x=a , P_2 : x=b \) perpendicular to the \(x\)-axis.
Find the area of the part of the sphere \(S\) that lies between the two planes \(P_1, P_2\).
An absolute or relative error of about \(10^{-6}\) is allowed.

Note 1: You are asked for the "area", not the "volume"!
Note 2: The area of the "cross section" has nothing to do with this!

Input

\(a\)
\(b\)

\(-1 \le a \lt b \le 1 \)
\(a, b\) are given to 4 decimal places.

Output

Output on one line the area of the part of the sphere \(S\) that lies between the two planes \(P_1, P_2\).
An absolute or relative error of about \(10^{-6}\) is allowed.

Sample

Sample 1
Input
-1.0000
1.0000
Output
12.56637061

This is the area of the entire sphere \(S\), so the answer is \(4 \pi\).

Sample 2
Input
0.0000
1.0000
Output
6.28318531

This is exactly half the area of the sphere \(S\), so the answer is \(2 \pi\).

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。