結果

問題 No.955 ax^2+bx+c=0
ユーザー roaris
提出日時 2019-12-18 00:08:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 475 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 82,264 KB
実行使用メモリ 54,600 KB
最終ジャッジ日時 2024-07-06 23:35:33
合計ジャッジ時間 6,165 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 89 WA * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, c = map(int, input().split())

if a==0:
    if b==0:
        if c==0:
            print(-1)
        else:
            print(0)
    else:
        print(1)
        print("{:.15f}".format(-c/b))
else:
    if b**2-4*a*c>0:
        print(2)
        print("{:.15f}".format((-b-(b**2-4*a*c)**0.5)/(2*a)))
        print("{:.15f}".format((-b+(b**2-4*a*c)**0.5)/(2*a)))
    elif b**2-4*a*c==0:
        print(1)
        print("{:.15f}".format(-b/(2*a)))
    else:
        print(0)
0