結果

問題 No.1381 Simple Geometry 1
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-02-07 21:01:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 363 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 86,936 KB
実行使用メモリ 76,960 KB
最終ジャッジ日時 2023-09-17 19:54:25
合計ジャッジ時間 5,151 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
76,728 KB
testcase_01 AC 114 ms
76,588 KB
testcase_02 AC 117 ms
76,472 KB
testcase_03 AC 112 ms
76,556 KB
testcase_04 AC 113 ms
76,624 KB
testcase_05 AC 113 ms
76,724 KB
testcase_06 AC 113 ms
76,624 KB
testcase_07 AC 113 ms
76,524 KB
testcase_08 AC 115 ms
76,788 KB
testcase_09 AC 113 ms
76,572 KB
testcase_10 AC 112 ms
76,492 KB
testcase_11 AC 117 ms
76,960 KB
testcase_12 AC 112 ms
76,712 KB
testcase_13 AC 116 ms
76,640 KB
testcase_14 AC 112 ms
76,568 KB
testcase_15 AC 112 ms
76,596 KB
testcase_16 AC 113 ms
76,628 KB
testcase_17 AC 114 ms
76,508 KB
testcase_18 AC 111 ms
76,872 KB
testcase_19 AC 112 ms
76,832 KB
testcase_20 AC 113 ms
76,644 KB
testcase_21 AC 113 ms
76,524 KB
testcase_22 AC 112 ms
76,692 KB
testcase_23 AC 118 ms
76,636 KB
testcase_24 AC 116 ms
76,692 KB
testcase_25 AC 116 ms
76,804 KB
testcase_26 AC 116 ms
76,744 KB
testcase_27 AC 114 ms
76,744 KB
testcase_28 AC 114 ms
76,560 KB
testcase_29 AC 113 ms
76,640 KB
testcase_30 AC 114 ms
76,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x, y, z, w = map(int, input().split())
l, r = 0, 10 ** 6
for i in range(200000):
    m = (l + r) / 2
    tate = x / m
    if tate < z:
        r = m
        continue
    BP = (tate ** 2 + y ** 2) ** 0.5
    BQ = (m ** 2 + z ** 2) ** 0.5
    if BQ + w > BP:
        r = m
    else:
        l = m
print(x - (r * z / 2 + (x / r) * y / 2 + (r - y) * (x / r - z) / 2))
0