結果

問題 No.955 ax^2+bx+c=0
ユーザー persimmon-persimmon
提出日時 2021-06-15 10:48:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 346 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 52,608 KB
最終ジャッジ日時 2024-12-26 05:36:34
合計ジャッジ時間 10,088 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 95 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c=map(int,input().split())
if a==0 and b==0 and c==0:
	print(-1)
elif a==0 and b==0:
	print(0)
elif a==0:
	print(1)
	print(-c/b)
else:
	tmp0=-4*c*a+b**2
	tmp=-c+b**2/(4*a)
	tmp/=a
	if tmp0<0:
		print(0)
	elif tmp0==0:
		print(1)
		print(-b/(2*a))
	else:
		import math
		tmp=math.sqrt(tmp)
		print(2)
		print(-tmp-b/(2*a))
		print(tmp-b/(2*a))
0