結果

問題 No.306 さいたま2008
ユーザー ryomacryomac
提出日時 2024-01-12 02:19:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 359 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 53,716 KB
最終ジャッジ日時 2024-01-12 02:19:23
合計ジャッジ時間 2,534 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,716 KB
testcase_01 AC 35 ms
53,716 KB
testcase_02 AC 39 ms
53,716 KB
testcase_03 AC 37 ms
53,716 KB
testcase_04 AC 35 ms
53,716 KB
testcase_05 AC 38 ms
53,716 KB
testcase_06 AC 36 ms
53,716 KB
testcase_07 AC 35 ms
53,716 KB
testcase_08 AC 35 ms
53,716 KB
testcase_09 AC 39 ms
53,716 KB
testcase_10 AC 38 ms
53,716 KB
testcase_11 AC 36 ms
53,716 KB
testcase_12 AC 35 ms
53,716 KB
testcase_13 AC 35 ms
53,716 KB
testcase_14 AC 36 ms
53,716 KB
testcase_15 AC 37 ms
53,716 KB
testcase_16 AC 36 ms
53,716 KB
testcase_17 AC 36 ms
53,716 KB
testcase_18 AC 36 ms
53,716 KB
testcase_19 AC 35 ms
53,716 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 35 ms
53,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x, y = map(int, input().split())
xx, yy = map(int, input().split())
from math import sqrt


def f(c):
    # (0,c)
    return sqrt((y - c) ** 2 + x**2) + sqrt((yy - c) ** 2 + xx**2)


l = 0
r = 10**9

while r - l > 10**-6:
    c1 = (l * 2 + r) / 3
    c2 = (l + r * 2) / 3
    if f(c1) <= f(c2):
        r = c2
    else:
        l = c1
print(r)
0