結果

問題 No.1179 Quadratic Equation
ユーザー daikisuyamadaikisuyama
提出日時 2020-08-21 22:08:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 670 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 71,748 KB
最終ジャッジ日時 2023-08-05 08:08:06
合計ジャッジ時間 2,342 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,100 KB
testcase_01 AC 89 ms
71,584 KB
testcase_02 AC 72 ms
71,364 KB
testcase_03 AC 72 ms
71,424 KB
testcase_04 AC 74 ms
71,456 KB
testcase_05 AC 73 ms
71,572 KB
testcase_06 AC 72 ms
71,432 KB
testcase_07 AC 71 ms
71,344 KB
testcase_08 AC 71 ms
71,348 KB
testcase_09 AC 73 ms
71,456 KB
testcase_10 AC 73 ms
71,348 KB
testcase_11 AC 73 ms
71,568 KB
testcase_12 AC 73 ms
71,288 KB
testcase_13 AC 72 ms
71,748 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