結果
| 問題 |
No.955 ax^2+bx+c=0
|
| コンテスト | |
| ユーザー |
StarMatyan
|
| 提出日時 | 2020-11-28 16:35:11 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 569 bytes |
| コンパイル時間 | 330 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-09-12 23:12:46 |
| 合計ジャッジ時間 | 6,932 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 41 WA * 61 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 a==0 and b<0:
print(-0)
elif a==0 and b>0:
print(0)
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)
StarMatyan