結果

問題 No.306 さいたま2008
ユーザー roiti46roiti46
提出日時 2015-11-27 22:51:37
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 522 bytes
コンパイル時間 589 ms
コンパイル使用メモリ 6,528 KB
実行使用メモリ 8,132 KB
最終ジャッジ日時 2023-10-12 00:15:56
合計ジャッジ時間 2,584 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
8,040 KB
testcase_01 AC 23 ms
7,904 KB
testcase_02 AC 24 ms
7,972 KB
testcase_03 AC 24 ms
7,984 KB
testcase_04 AC 23 ms
8,064 KB
testcase_05 AC 24 ms
7,920 KB
testcase_06 AC 24 ms
7,892 KB
testcase_07 AC 24 ms
8,064 KB
testcase_08 AC 24 ms
8,084 KB
testcase_09 AC 24 ms
7,980 KB
testcase_10 AC 24 ms
8,104 KB
testcase_11 AC 24 ms
8,132 KB
testcase_12 AC 24 ms
7,884 KB
testcase_13 AC 25 ms
8,068 KB
testcase_14 AC 26 ms
8,112 KB
testcase_15 AC 24 ms
7,864 KB
testcase_16 AC 24 ms
8,068 KB
testcase_17 AC 24 ms
7,900 KB
testcase_18 AC 24 ms
8,100 KB
testcase_19 AC 24 ms
7,860 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 24 ms
7,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

def dist(y):
    res = math.sqrt((ya - y)**2 + xa**2) + math.sqrt((yb- y)**2 + xb**2)
    return res


xa, ya = map(int, raw_input().split())
xb, yb = map(int, raw_input().split())

low, hi = 0.0, 1001.0
while hi - low > 1e-9:
    mid_l = (2*low + hi)/3
    mid_r = (low + 2*hi)/3
    d_l = dist(mid_l)
    d_r = dist(mid_r)
    if d_l < d_r:
        hi = mid_r
    else:
        low = mid_l
print "%.10f" % mid_l
0