結果

問題 No.1179 Quadratic Equation
ユーザー H3PO4H3PO4
提出日時 2020-08-21 22:10:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 223 bytes
コンパイル時間 769 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 30,592 KB
最終ジャッジ日時 2023-08-05 08:09:54
合計ジャッジ時間 2,998 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 147 ms
29,560 KB
testcase_01 AC 139 ms
30,380 KB
testcase_02 AC 139 ms
30,372 KB
testcase_03 AC 143 ms
29,548 KB
testcase_04 AC 137 ms
29,512 KB
testcase_05 AC 136 ms
30,592 KB
testcase_06 AC 133 ms
30,304 KB
testcase_07 AC 133 ms
30,376 KB
testcase_08 AC 136 ms
30,384 KB
testcase_09 AC 135 ms
30,276 KB
testcase_10 AC 136 ms
30,268 KB
testcase_11 AC 133 ms
30,424 KB
testcase_12 AC 135 ms
30,140 KB
testcase_13 AC 138 ms
30,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

A, B, C = map(int, input().split())
if (D := B ** 2 - 4 * A * C) < 0:
    print('imaginary')
else:
    x1, x2 = np.roots([A, B, C])
    if D:
        print(*sorted([x1, x2]))
    else:
        print(x1)
0