結果

問題 No.955 ax^2+bx+c=0
ユーザー AEnAEn
提出日時 2022-06-15 20:14:59
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 333 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 82,316 KB
実行使用メモリ 66,928 KB
最終ジャッジ日時 2024-10-04 17:55:27
合計ジャッジ時間 7,520 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 107 RE * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c=map(int,input().split())
D=b*b-4*a*c
if a == 0:
    if b == 0:
        print(-1 if c==0 else 0)
    else:
        print(1,-c/b,sep='\n')
else:
    if D==0:
        print(1,-b/a/2,sep='\n')
    elif D<0:
        print(0)
    else:
        p=(-b-D**(0.5))/2/a
        q=c/a/p
        if p>q:p,q=q,p
        print(2,p,q,sep='\n')
0