結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,976 KB
testcase_01 AC 15 ms
8,036 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,900 KB
testcase_16 AC 15 ms
7,960 KB
testcase_17 AC 16 ms
7,972 KB
testcase_18 RE -
testcase_19 AC 16 ms
7,984 KB
testcase_20 AC 15 ms
7,932 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