結果

問題 No.1381 Simple Geometry 1
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-02-07 21:04:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 87,568 KB
実行使用メモリ 71,952 KB
最終ジャッジ日時 2023-09-17 20:00:19
合計ジャッジ時間 4,021 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,840 KB
testcase_01 AC 71 ms
71,800 KB
testcase_02 AC 72 ms
71,304 KB
testcase_03 AC 72 ms
71,516 KB
testcase_04 AC 72 ms
71,856 KB
testcase_05 AC 73 ms
71,952 KB
testcase_06 AC 73 ms
71,580 KB
testcase_07 AC 73 ms
71,388 KB
testcase_08 AC 72 ms
71,624 KB
testcase_09 AC 73 ms
71,540 KB
testcase_10 AC 74 ms
71,740 KB
testcase_11 AC 74 ms
71,764 KB
testcase_12 AC 73 ms
71,532 KB
testcase_13 AC 72 ms
71,848 KB
testcase_14 AC 76 ms
71,304 KB
testcase_15 AC 76 ms
71,540 KB
testcase_16 AC 75 ms
71,336 KB
testcase_17 AC 74 ms
71,564 KB
testcase_18 AC 72 ms
71,556 KB
testcase_19 AC 74 ms
71,340 KB
testcase_20 AC 75 ms
71,556 KB
testcase_21 AC 75 ms
71,320 KB
testcase_22 AC 73 ms
71,584 KB
testcase_23 AC 75 ms
71,536 KB
testcase_24 AC 74 ms
71,616 KB
testcase_25 AC 72 ms
71,368 KB
testcase_26 AC 71 ms
71,536 KB
testcase_27 AC 74 ms
71,620 KB
testcase_28 AC 72 ms
71,576 KB
testcase_29 AC 72 ms
71,748 KB
testcase_30 AC 72 ms
71,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from sys import stdin

X,Y,Z,W = map(int,stdin.readline().split())

l = Y
r = X+1

while r-l > 10**(-5):

    m = (l+r)/2

    apy = m
    bpz = X / m

    bp2 = Y**2 + bpz**2
    bq2 = Z**2 + apy**2

    #bp2が大きすぎる = bzが大きすぎる = ayが小さすぎる場合
    if bp2 > bq2 and bp2**0.5-bq2**0.5 > W:
        l = m
    else:
        r = m

a = (l+r)/2 - Y
b = X / (a+Y) - Z

print ( X - (a*b + (a+Y)*Z + Y*(b+Z) )/2 )
0