結果
| 問題 | No.306 さいたま2008 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-11-27 22:57:41 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 540 bytes |
| 記録 | |
| コンパイル時間 | 144 ms |
| コンパイル使用メモリ | 77,572 KB |
| 最終ジャッジ日時 | 2025-12-03 17:56:37 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 4 RE * 4 |
ソースコード
# -*- 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" % mid_l