結果

問題 No.955 ax^2+bx+c=0
ユーザー convexineq
提出日時 2021-05-21 21:07:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 326 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 54,284 KB
最終ジャッジ日時 2024-10-10 07:31:06
合計ジャッジ時間 7,748 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 92 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c = map(int,input().split())
D = b*b-4*a*c
if a==0:
    if b==0:
        print(0 if c else -1)
    else:
        print(-c/b)
elif D < 0:
    print(0)
elif D==0:
    print(1)
    print(-b/2/a)
else:
    print(2)
    if b < 0:
        a,b,c = -a,-b,-c
    r = -(b+D**0.5)/2/a
    s = c/a/r
    print(*sorted([r,s]),sep="\n")
0