結果
問題 |
No.955 ax^2+bx+c=0
|
ユーザー |
![]() |
提出日時 | 2019-12-18 04:21:53 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 597 bytes |
コンパイル時間 | 257 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,264 KB |
最終ジャッジ日時 | 2024-07-07 00:31:16 |
合計ジャッジ時間 | 6,947 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 97 WA * 25 |
ソースコード
a,b,c=map(int,input().split()) import math from decimal import * getcontext().prec = 50 ANS=[] if a!=0: if b**2-4*a*c>0: print(2) ANS.append((Decimal(-b)+Decimal(math.sqrt(b**2-4*a*c)))/Decimal(2*a)) ANS.append((Decimal(-b)-Decimal(math.sqrt(b**2-4*a*c)))/Decimal(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)