結果

問題 No.306 さいたま2008
ユーザー fmhrfmhr
提出日時 2015-11-28 00:11:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 481 bytes
コンパイル時間 505 ms
コンパイル使用メモリ 87,360 KB
実行使用メモリ 76,500 KB
最終ジャッジ日時 2023-10-12 00:33:19
合計ジャッジ時間 3,513 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,672 KB
testcase_01 AC 67 ms
71,676 KB
testcase_02 AC 66 ms
71,516 KB
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 AC 66 ms
71,176 KB
testcase_14 AC 67 ms
71,400 KB
testcase_15 AC 68 ms
71,676 KB
testcase_16 AC 68 ms
71,392 KB
testcase_17 AC 67 ms
71,500 KB
testcase_18 AC 67 ms
71,188 KB
testcase_19 AC 67 ms
71,436 KB
testcase_20 AC 66 ms
71,656 KB
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding:utf-8

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(5000000):
        if yb == mid or ya == mid:
            break
        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