結果

問題 No.1179 Quadratic Equation
ユーザー anagohirameanagohirame
提出日時 2020-08-21 22:59:19
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 264 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 71,648 KB
最終ジャッジ日時 2023-08-05 08:38:22
合計ジャッジ時間 2,156 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,356 KB
testcase_01 AC 73 ms
71,624 KB
testcase_02 AC 76 ms
71,332 KB
testcase_03 AC 74 ms
71,400 KB
testcase_04 AC 74 ms
71,580 KB
testcase_05 AC 73 ms
71,240 KB
testcase_06 AC 74 ms
71,648 KB
testcase_07 AC 73 ms
71,532 KB
testcase_08 AC 72 ms
71,472 KB
testcase_09 AC 71 ms
71,156 KB
testcase_10 AC 69 ms
71,264 KB
testcase_11 AC 69 ms
71,332 KB
testcase_12 AC 72 ms
71,628 KB
testcase_13 AC 74 ms
71,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, c = map(int, input().split())
if b*b < 4*a*c:
	print("imaginary")
elif b*b == 4*a*c:
	print(-b/a/2)
else:
	axis = -b/a/2
	l, r = axis, 10**10
	for _ in range(50):
		x = (l+r)/2
		if (a*x*x + b*x + c > 0) ^ (a>0):
			l = x
		else:
			r = x
	print(2*axis-x, x)
0