結果
| 問題 |
No.955 ax^2+bx+c=0
|
| コンテスト | |
| ユーザー |
StarMatyan
|
| 提出日時 | 2020-11-28 16:30:34 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 522 bytes |
| コンパイル時間 | 676 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-09-12 23:11:11 |
| 合計ジャッジ時間 | 7,121 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 54 WA * 48 RE * 20 |
ソースコード
import math
a,b,c = map(int,input().split(" "))
left_num = int(math.pow(b,2))
right_num = int(4*a*c)
a_bunbo=int(2*a)
if left_num== right_num and not(a==0 and b==0) or (a==0 and c==0 and (b<0 or b>0)):
print(1)
if a > 0 or a < 0:
print(round(-b/a_bunbo,18))
elif left_num> right_num and not(a==0 and c==0 and (b<0 or b>0)):
print(2)
print(round(-(b+math.sqrt(left_num- right_num))/a_bunbo,18))
print(round(-(b-math.sqrt(left_num- right_num))/a_bunbo,18))
elif (a==0 and b==0 and c ==0):
print(-1)
else:
print(0)
StarMatyan