結果
| 問題 |
No.955 ax^2+bx+c=0
|
| コンテスト | |
| ユーザー |
AEn
|
| 提出日時 | 2022-06-15 19:59:40 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 410 bytes |
| コンパイル時間 | 204 ms |
| コンパイル使用メモリ | 81,836 KB |
| 実行使用メモリ | 54,508 KB |
| 最終ジャッジ日時 | 2024-10-04 17:21:31 |
| 合計ジャッジ時間 | 7,161 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 69 WA * 53 |
ソースコード
import math as m
a,b,c = map(int, input().split())
if a == 0:
if b == 0:
if c == 0:
print(-1)
else:
print(0)
else:
print(1,c/b,sep='\n')
else:
if b*b-4*a*c>=0:
p,q=(-b-m.sqrt(b*b-4*a*c))/2/a,(-b+m.sqrt(b*b-4*a*c))/2/a
if p!=q:
print(2,p,q,sep='\n')
else:
print(1,p,sep='\n')
else:
print(0)
AEn