結果

問題 No.1179 Quadratic Equation
ユーザー daikisuyamadaikisuyama
提出日時 2020-08-21 22:08:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,184 KB
実行使用メモリ 53,420 KB
最終ジャッジ日時 2024-04-23 05:55:22
合計ジャッジ時間 1,370 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,084 KB
testcase_01 AC 44 ms
52,872 KB
testcase_02 AC 38 ms
52,468 KB
testcase_03 AC 38 ms
53,072 KB
testcase_04 AC 38 ms
53,420 KB
testcase_05 AC 39 ms
53,172 KB
testcase_06 AC 38 ms
52,660 KB
testcase_07 AC 39 ms
52,256 KB
testcase_08 AC 38 ms
53,052 KB
testcase_09 AC 38 ms
52,744 KB
testcase_10 AC 38 ms
52,664 KB
testcase_11 AC 38 ms
52,672 KB
testcase_12 AC 38 ms
53,380 KB
testcase_13 AC 37 ms
52,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt
a,b,c=map(int,input().split())
if a<0:
    a,b,c=-a,-b,-c
d=b**2-4*a*c
if d<0:
    print("imaginary")
elif d==0:
    print(-(b/2/a))
else:
    print(-((b+sqrt(d))/2/a),-((b-sqrt(d))/2/a))
0