結果

問題 No.306 さいたま2008
ユーザー proribone
提出日時 2020-10-21 22:07:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 330 ms / 2,000 ms
コード長 408 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 82,644 KB
実行使用メモリ 83,776 KB
最終ジャッジ日時 2025-02-14 12:17:33
合計ジャッジ時間 9,787 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import Decimal as d
xa,ya=map(d,input().split())
xb,yb=map(d,input().split())


def f(yp):
    s=d('2')
    AP=(xa**s+(yp-ya)**s).sqrt()
    BP=(xb**s+(yp-yb)**s).sqrt()
    return (AP+BP)

low,high=d('-1000'),d('2000')

D=d('10')**d('-9')

while(high-low)>D:
    l2=(low*d('2')+high)/d('3')
    h2=(low+high*d('2'))/d('3')
    if f(l2)>f(h2):
        low=l2
    else:
        high=h2
print(low)
0