結果

問題 No.1179 Quadratic Equation
ユーザー jupiro
提出日時 2020-08-21 22:44:05
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 375 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-10-15 06:02:53
合計ジャッジ時間 1,237 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 1
other AC * 3 RE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import *

ta,tb,tc = map(int, input().split())

a = Decimal(ta)
b = Decimal(tb)
c = Decimal(tc)
d = tb *tb - 4 * a*c
D = b * b - 4 * a * c
if d > 0:
    exit(1)
    res1 = (-b - D.sqrt()) / (2 * a)
    res2 = (-b + D.sqrt()) / (2 * a)
    print("{} {}".format(res1, res2))
elif d == 0:
    res1 = (-b) / (2 * a)
    print(res1)
else:
    print("imaginary")
    
0