結果

問題 No.306 さいたま2008
ユーザー tjaketjake
提出日時 2015-12-04 00:07:25
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 543 bytes
コンパイル時間 49 ms
コンパイル使用メモリ 6,984 KB
実行使用メモリ 6,188 KB
最終ジャッジ日時 2023-10-12 09:39:29
合計ジャッジ時間 1,380 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,140 KB
testcase_01 AC 11 ms
6,124 KB
testcase_02 AC 11 ms
6,008 KB
testcase_03 AC 12 ms
6,056 KB
testcase_04 AC 12 ms
6,040 KB
testcase_05 AC 12 ms
6,024 KB
testcase_06 AC 12 ms
6,108 KB
testcase_07 AC 12 ms
6,188 KB
testcase_08 AC 11 ms
6,184 KB
testcase_09 AC 11 ms
6,040 KB
testcase_10 AC 12 ms
6,040 KB
testcase_11 AC 11 ms
6,136 KB
testcase_12 AC 12 ms
6,068 KB
testcase_13 AC 12 ms
5,968 KB
testcase_14 AC 11 ms
6,132 KB
testcase_15 AC 11 ms
6,136 KB
testcase_16 AC 12 ms
6,136 KB
testcase_17 AC 11 ms
6,112 KB
testcase_18 AC 12 ms
5,968 KB
testcase_19 AC 11 ms
6,064 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 11 ms
6,036 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**16
xb2 = xb**2*10**16
ya *= 10**8
yb *= 10**8

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 left/10.**8
0