結果

問題 No.306 さいたま2008
ユーザー fmhrfmhr
提出日時 2015-11-28 00:04:59
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 456 bytes
コンパイル時間 598 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 79,044 KB
最終ジャッジ日時 2023-10-12 00:26:10
合計ジャッジ時間 4,092 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,232 KB
testcase_01 AC 75 ms
71,540 KB
testcase_02 RE -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 77 ms
71,284 KB
testcase_16 AC 74 ms
71,244 KB
testcase_17 AC 77 ms
71,392 KB
testcase_18 RE -
testcase_19 AC 75 ms
71,436 KB
testcase_20 AC 77 ms
71,568 KB
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding:utf-8
import math
def main():
    xa, ya = map(int, input().split())
    xb, yb = map(int, input().split())
    if ya > yb:
        xa,xb = xb,xa
        ya,yb = yb,ya
    ub = yb
    lb = ya
    mid = (lb+ub)/2
    for i in range(1000000):
        # print(mid)
        if xb/(yb-mid)>xa/(mid-ya):
            mid = (mid+lb)/2
        elif xb/(yb-mid)<xa/(mid-ya):
            mid = (mid+ub)/2
        else:
            break
    print(mid)
main()
0