結果

問題 No.1179 Quadratic Equation
ユーザー brthyyjpbrthyyjp
提出日時 2021-11-18 01:07:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 886 ms
コンパイル使用メモリ 86,700 KB
実行使用メモリ 71,576 KB
最終ジャッジ日時 2023-08-25 22:57:26
合計ジャッジ時間 3,243 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,268 KB
testcase_01 AC 73 ms
71,488 KB
testcase_02 AC 74 ms
71,380 KB
testcase_03 AC 72 ms
70,972 KB
testcase_04 AC 72 ms
71,200 KB
testcase_05 AC 72 ms
71,264 KB
testcase_06 AC 73 ms
71,244 KB
testcase_07 AC 72 ms
71,236 KB
testcase_08 AC 72 ms
71,108 KB
testcase_09 AC 71 ms
71,396 KB
testcase_10 AC 72 ms
71,576 KB
testcase_11 AC 73 ms
71,308 KB
testcase_12 AC 71 ms
71,096 KB
testcase_13 AC 72 ms
71,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, c = map(int, input().split())
import math
D = b**2-4*a*c
if a < 0:
    a, b, c = -a, -b, -c
if D < 0:
    print('imaginary')
elif D == 0:
    print((-b)/(2*a))
else:
    x1 = (-b-math.sqrt(D))/(2*a)
    x2 = (-b+math.sqrt(D))/(2*a)
    print(x1, x2)
0