結果
問題 | No.955 ax^2+bx+c=0 |
ユーザー |
![]() |
提出日時 | 2019-12-18 04:11:14 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 502 bytes |
コンパイル時間 | 200 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-07 00:29:18 |
合計ジャッジ時間 | 6,643 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 97 WA * 25 |
ソースコード
a,b,c=map(int,input().split()) import math ANS=[] if a!=0: if b**2-4*a*c>0: print(2) ANS.append((-b+math.sqrt(b**2-4*a*c))/(2*a)) ANS.append((-b-math.sqrt(b**2-4*a*c))/(2*a)) for a in sorted(ANS): print(a) elif b**2-4*a*c==0: print(1) print(-b/(2*a)) else: print(0) else: if b!=0: print(1) print(-c/b) else: if c==0: print(-1) else: print(0)