結果

問題 No.955 ax^2+bx+c=0
コンテスト
ユーザー ianCK
提出日時 2019-12-18 03:29:45
言語 Python3
(3.14.3 + numpy 2.4.2 + scipy 1.17.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 469 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 504 ms
コンパイル使用メモリ 20,700 KB
実行使用メモリ 20,704 KB
最終ジャッジ日時 2026-03-28 14:32:51
合計ジャッジ時間 16,004 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 1
other AC * 65 WA * 49 RE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

s = input().split()
a = float(s[0])
b = float(s[1])
c = float(s[2])
if a == 0 : 
    if b == 0 :
        if c == 0 : print(-1)
        else : print(0)
    else : print(1, c / b, sep = '\n')
else :
    if a < 0 :
        a = -a
        b = -b
        c = -c
    d = b * b - 4 * a * c
    d = d ** 0.5
    if d > 0 : print(2, (-b - d) / (a * 2), (-b + d) / (a * 2), sep = '\n')
    elif d < 0 : print(0)
    else : print(1, -b / (a * 2), sep = '\n')

0