結果

問題 No.1179 Quadratic Equation
ユーザー tktk_snsntktk_snsn
提出日時 2020-08-21 22:29:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 30,408 KB
最終ジャッジ日時 2023-08-05 08:25:52
合計ジャッジ時間 2,972 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
29,552 KB
testcase_01 AC 141 ms
30,368 KB
testcase_02 AC 138 ms
30,336 KB
testcase_03 AC 138 ms
29,436 KB
testcase_04 AC 138 ms
29,424 KB
testcase_05 AC 138 ms
30,240 KB
testcase_06 AC 143 ms
30,312 KB
testcase_07 AC 141 ms
30,220 KB
testcase_08 AC 143 ms
30,312 KB
testcase_09 AC 141 ms
30,204 KB
testcase_10 AC 140 ms
30,392 KB
testcase_11 AC 141 ms
30,408 KB
testcase_12 AC 140 ms
30,112 KB
testcase_13 AC 141 ms
30,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
a, b, c = map(int, input().split())

if b * b < 4 * a * c:
    print("imaginary")
else:
    x, y = np.roots([a, b, c])
    if x == y:
        print(x)
    elif x > y:
        print(y, x)
    else:
        print(x, y)
0