結果

問題 No.1179 Quadratic Equation
ユーザー lemondolemondo
提出日時 2020-08-21 23:20:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 324 bytes
コンパイル時間 1,587 ms
コンパイル使用メモリ 81,688 KB
実行使用メモリ 54,036 KB
最終ジャッジ日時 2024-04-23 06:33:11
合計ジャッジ時間 1,333 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,760 KB
testcase_01 AC 40 ms
52,852 KB
testcase_02 WA -
testcase_03 AC 40 ms
52,808 KB
testcase_04 AC 38 ms
52,796 KB
testcase_05 AC 38 ms
53,972 KB
testcase_06 AC 38 ms
52,456 KB
testcase_07 AC 37 ms
53,208 KB
testcase_08 AC 37 ms
52,496 KB
testcase_09 AC 37 ms
53,944 KB
testcase_10 AC 39 ms
54,036 KB
testcase_11 WA -
testcase_12 AC 39 ms
52,712 KB
testcase_13 AC 38 ms
53,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

a, b, c = mapint()
if b**2<4*a*c:
    print("imaginary")
else:
    base = (b**2-4*a*c)**(1/2)
    ans1 = (-b+base)/a/2
    ans2 = (-b-base)/a/2
    print(min(ans1, ans2), max(ans1, ans2))
0