結果

問題 No.306 さいたま2008
ユーザー fmhrfmhr
提出日時 2015-11-28 00:04:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 456 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,864 KB
実行使用メモリ 8,088 KB
最終ジャッジ日時 2023-10-12 00:25:34
合計ジャッジ時間 19,898 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,988 KB
testcase_01 AC 17 ms
7,996 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 16 ms
7,940 KB
testcase_16 AC 17 ms
7,892 KB
testcase_17 AC 17 ms
8,088 KB
testcase_18 RE -
testcase_19 AC 16 ms
7,932 KB
testcase_20 AC 16 ms
7,948 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(5000000):
        # 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