結果

問題 No.306 さいたま2008
ユーザー tjaketjake
提出日時 2015-12-04 00:14:15
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 556 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 7,064 KB
実行使用メモリ 6,108 KB
最終ジャッジ日時 2023-10-12 09:40:35
合計ジャッジ時間 1,431 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,108 KB
testcase_01 AC 13 ms
6,008 KB
testcase_02 AC 12 ms
5,920 KB
testcase_03 AC 12 ms
6,096 KB
testcase_04 AC 12 ms
6,016 KB
testcase_05 AC 13 ms
6,100 KB
testcase_06 AC 12 ms
6,012 KB
testcase_07 AC 13 ms
6,108 KB
testcase_08 AC 12 ms
6,096 KB
testcase_09 AC 12 ms
6,092 KB
testcase_10 AC 12 ms
6,012 KB
testcase_11 AC 12 ms
6,016 KB
testcase_12 AC 12 ms
6,108 KB
testcase_13 AC 12 ms
5,908 KB
testcase_14 AC 11 ms
5,940 KB
testcase_15 AC 12 ms
5,992 KB
testcase_16 AC 12 ms
5,908 KB
testcase_17 AC 13 ms
6,104 KB
testcase_18 AC 12 ms
5,912 KB
testcase_19 AC 12 ms
5,996 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 13 ms
5,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt
inputs = lambda:map(int, raw_input().split())
xa, ya = inputs()
xb, yb = inputs()

if ya > yb:
    xa, ya, xb, yb = xb, yb, xa, ya
xa2 = xa**2*10**30
xb2 = xb**2*10**30
ya *= 10**15
yb *= 10**15

def calc(yp):
    return sqrt(xa2+(ya-yp)**2) + sqrt(xb2+(yb-yp)**2)

left = ya; right = yb
while 1:
    lm = (2*left+right)/3
    rm = (left+2*right)/3
    lc = calc(lm)
    rc = calc(rm)
    if lc < rc:
        if rm==right: break
        right = rm
    else:
        if lm==left: break
        left = lm
print "%.08f" % (left/10.**15)
0