結果

問題 No.605 板挟みの球面
ユーザー Konton7
提出日時 2019-10-04 00:08:43
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-03 06:45:25
合計ジャッジ時間 893 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 3
権限があれば一括ダウンロードができます

ソースコード

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 += 4 * 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