結果
| 問題 | 
                            No.306 さいたま2008
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2015-11-27 22:59:22 | 
| 言語 | Python2  (2.7.18)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 551 bytes | 
| コンパイル時間 | 615 ms | 
| コンパイル使用メモリ | 6,912 KB | 
| 実行使用メモリ | 8,448 KB | 
| 最終ジャッジ日時 | 2024-09-14 00:17:53 | 
| 合計ジャッジ時間 | 1,467 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 21 WA * 2 | 
ソースコード
# -*- 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 = min(ya, yb), max(ya, yb) 
while hi - low > 1e-11:
    mid_l = (2*low + hi)/3.0
    mid_r = (low + 2*hi)/3.0
    d_l = dist(mid_l)
    d_r = dist(mid_r)
    if d_l < d_r:
        hi = mid_r
    else:
        low = mid_l
print "%.10f" % ((low + hi)/2.0)