結果

問題 No.955 ax^2+bx+c=0
コンテスト
ユーザー StarMatyan
提出日時 2020-11-28 16:35:11
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 569 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 353 ms
コンパイル使用メモリ 20,704 KB
実行使用メモリ 20,892 KB
最終ジャッジ日時 2026-04-04 02:08:33
合計ジャッジ時間 17,573 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 41 WA * 61 RE * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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)
0