結果

問題 No.1179 Quadratic Equation
ユーザー H3PO4H3PO4
提出日時 2020-08-21 22:10:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 542 ms / 2,000 ms
コード長 223 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 45,188 KB
最終ジャッジ日時 2024-04-23 05:56:59
合計ジャッジ時間 8,726 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 532 ms
43,924 KB
testcase_01 AC 530 ms
45,088 KB
testcase_02 AC 527 ms
44,832 KB
testcase_03 AC 529 ms
44,432 KB
testcase_04 AC 528 ms
44,020 KB
testcase_05 AC 542 ms
44,836 KB
testcase_06 AC 527 ms
45,084 KB
testcase_07 AC 529 ms
44,832 KB
testcase_08 AC 531 ms
45,088 KB
testcase_09 AC 537 ms
45,088 KB
testcase_10 AC 527 ms
44,940 KB
testcase_11 AC 541 ms
45,188 KB
testcase_12 AC 523 ms
44,580 KB
testcase_13 AC 539 ms
44,852 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