結果

問題 No.306 さいたま2008
ユーザー proriboneproribone
提出日時 2020-10-21 22:07:50
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 457 ms / 2,000 ms
コード長 408 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 94,084 KB
最終ジャッジ日時 2023-09-28 14:28:37
合計ジャッジ時間 12,238 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 455 ms
93,388 KB
testcase_01 AC 448 ms
93,168 KB
testcase_02 AC 450 ms
93,052 KB
testcase_03 AC 448 ms
93,052 KB
testcase_04 AC 445 ms
92,980 KB
testcase_05 AC 451 ms
93,112 KB
testcase_06 AC 455 ms
94,084 KB
testcase_07 AC 446 ms
92,984 KB
testcase_08 AC 446 ms
93,108 KB
testcase_09 AC 448 ms
93,468 KB
testcase_10 AC 452 ms
92,984 KB
testcase_11 AC 449 ms
92,944 KB
testcase_12 AC 457 ms
93,428 KB
testcase_13 AC 445 ms
92,928 KB
testcase_14 AC 449 ms
93,100 KB
testcase_15 AC 445 ms
93,512 KB
testcase_16 AC 455 ms
93,160 KB
testcase_17 AC 441 ms
93,124 KB
testcase_18 AC 442 ms
93,064 KB
testcase_19 AC 445 ms
93,056 KB
testcase_20 AC 446 ms
93,144 KB
testcase_21 AC 445 ms
92,920 KB
testcase_22 AC 451 ms
93,248 KB
権限があれば一括ダウンロードができます

ソースコード

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