結果

問題 No.306 さいたま2008
コンテスト
ユーザー ryomac
提出日時 2024-01-12 02:19:20
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 344 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 117 ms
コンパイル使用メモリ 85,632 KB
実行使用メモリ 52,736 KB
最終ジャッジ日時 2026-04-14 14:27:52
合計ジャッジ時間 1,769 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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