結果
問題 | No.306 さいたま2008 |
ユーザー |
|
提出日時 | 2015-11-27 22:51:56 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 523 bytes |
コンパイル時間 | 405 ms |
コンパイル使用メモリ | 7,168 KB |
実行使用メモリ | 8,532 KB |
最終ジャッジ日時 | 2024-09-14 00:12:04 |
合計ジャッジ時間 | 1,421 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 WA * 2 |
ソースコード
# -*- coding: utf-8 -*-import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as colldef dist(y):res = math.sqrt((ya - y)**2 + xa**2) + math.sqrt((yb- y)**2 + xb**2)return resxa, ya = map(int, raw_input().split())xb, yb = map(int, raw_input().split())low, hi = 0.0, 1001.0while hi - low > 1e-11:mid_l = (2*low + hi)/3mid_r = (low + 2*hi)/3d_l = dist(mid_l)d_r = dist(mid_r)if d_l < d_r:hi = mid_relse:low = mid_lprint "%.10f" % mid_l