結果

問題 No.605 板挟みの球面
ユーザー Konton7Konton7
提出日時 2019-10-04 00:09:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 396 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-14 09:47:02
合計ジャッジ時間 1,031 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 117 ms
10,880 KB
testcase_03 AC 31 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
p = math.pi

def surface(x):
    d = 10**-5
    x2 = int(x * 100000)
    b = 10**5 - x2
    ans = 0
    for i in range(b):
        ans += 2 * p * d * ( 1 - ( (1-d*i)**2 ) ** 0.5 )
    return ans

a, b = float(input()), float(input())
if a >= 0:
    print( surface(a) - surface(b) )
elif b >= 0:
    print( 4*p - surface(b) - surface(-a) )
else:
    print( surface(-b) - surface(-a) )
0