結果

問題 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  
実行時間 457 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 43,844 KB
最終ジャッジ日時 2024-04-23 06:10:30
合計ジャッジ時間 7,915 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 446 ms
43,580 KB
testcase_01 AC 444 ms
43,704 KB
testcase_02 AC 449 ms
43,840 KB
testcase_03 AC 442 ms
43,708 KB
testcase_04 AC 439 ms
43,708 KB
testcase_05 AC 439 ms
43,584 KB
testcase_06 AC 450 ms
43,844 KB
testcase_07 AC 444 ms
43,572 KB
testcase_08 AC 446 ms
43,720 KB
testcase_09 AC 448 ms
43,704 KB
testcase_10 AC 448 ms
43,568 KB
testcase_11 AC 448 ms
43,584 KB
testcase_12 AC 450 ms
43,824 KB
testcase_13 AC 457 ms
43,824 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