結果

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

ソースコード

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(1)
        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