結果

問題 No.1381 Simple Geometry 1
ユーザー rlangevinrlangevin
提出日時 2023-01-22 01:42:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 87,776 KB
実行使用メモリ 72,140 KB
最終ジャッジ日時 2023-09-06 12:24:23
合計ジャッジ時間 4,534 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
72,052 KB
testcase_01 AC 73 ms
71,532 KB
testcase_02 AC 73 ms
71,536 KB
testcase_03 AC 77 ms
71,832 KB
testcase_04 AC 77 ms
71,700 KB
testcase_05 AC 74 ms
71,916 KB
testcase_06 AC 74 ms
71,860 KB
testcase_07 AC 76 ms
72,132 KB
testcase_08 AC 72 ms
71,880 KB
testcase_09 AC 73 ms
71,936 KB
testcase_10 AC 74 ms
71,952 KB
testcase_11 AC 75 ms
72,124 KB
testcase_12 AC 75 ms
71,888 KB
testcase_13 AC 74 ms
71,844 KB
testcase_14 AC 75 ms
71,764 KB
testcase_15 AC 75 ms
71,700 KB
testcase_16 AC 76 ms
71,860 KB
testcase_17 AC 74 ms
72,076 KB
testcase_18 AC 73 ms
71,684 KB
testcase_19 AC 74 ms
71,876 KB
testcase_20 AC 74 ms
72,140 KB
testcase_21 AC 74 ms
71,816 KB
testcase_22 AC 71 ms
71,900 KB
testcase_23 AC 75 ms
71,996 KB
testcase_24 AC 74 ms
71,876 KB
testcase_25 AC 73 ms
71,872 KB
testcase_26 AC 72 ms
71,700 KB
testcase_27 AC 73 ms
72,136 KB
testcase_28 AC 72 ms
71,700 KB
testcase_29 AC 73 ms
72,044 KB
testcase_30 AC 73 ms
71,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import *

X, Y, Z, W = map(int, input().split())
eps = 10**-6

yes = eps
no = 10 ** 18
while no - yes > eps:
    mid = (yes + no)/2
    if sqrt(mid ** 2 + Y ** 2) < sqrt((X/mid)**2 + Z ** 2) + W:
        yes = mid
    else:
        no = mid
t = yes
a = sqrt(Y ** 2 + t ** 2)
b = sqrt(Z ** 2 + (X / t) ** 2)
c = sqrt((X/t - Y) ** 2 + (t - Z) ** 2)
s = (a + b + c)/2
print(sqrt(s * (s - a) * (s - b) * (s - c)))
0