結果
問題 |
No.306 さいたま2008
|
ユーザー |
![]() |
提出日時 | 2015-12-04 00:05:58 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 478 bytes |
コンパイル時間 | 142 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-14 08:33:59 |
合計ジャッジ時間 | 1,451 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 WA * 2 |
ソースコード
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 def calc(yp): return sqrt(xa**2+(ya-yp)**2) + sqrt(xb**2+(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