結果

問題 No.955 ax^2+bx+c=0
ユーザー tanon710
提出日時 2020-05-04 19:13:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 533 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 52,736 KB
最終ジャッジ日時 2024-06-24 20:57:19
合計ジャッジ時間 7,173 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 102 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c=map(int,input().split())
if a!=0:
    if b*b-4*a*c<0:
        print(0)
    elif b*b==4*a*c:
        print(1)
        print(-b/(2*a))
    elif b*b>4*a*c:
        if b>0:
            ans1=(-b-(b**2-4*a*c)**0.5)/(2*a)
            ans2=c/(a*ans1)
        else:
            ans2=(-b+(b**2-4*a*c)**0.5)/(2*a)
            ans1=c/(a*ans2)
        print(2)
        print(ans1)
        print(ans2)
else:
    if b!=0:
        print(1)
        print(-c/b)
    else:
        if c!=0:
            print(0)
        else:
            print(-1)
0