結果

問題 No.1179 Quadratic Equation
ユーザー uni_pythonuni_python
提出日時 2020-08-21 22:07:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 495 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 71,836 KB
最終ジャッジ日時 2023-08-05 08:07:38
合計ジャッジ時間 2,203 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,020 KB
testcase_01 AC 72 ms
71,704 KB
testcase_02 AC 72 ms
71,236 KB
testcase_03 AC 72 ms
71,088 KB
testcase_04 AC 71 ms
71,116 KB
testcase_05 AC 71 ms
71,660 KB
testcase_06 AC 71 ms
71,552 KB
testcase_07 AC 71 ms
71,652 KB
testcase_08 AC 71 ms
71,708 KB
testcase_09 AC 73 ms
71,732 KB
testcase_10 WA -
testcase_11 AC 71 ms
71,176 KB
testcase_12 AC 72 ms
71,560 KB
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    a,b,c=MI()
    
    D=b*b - 4*a*c
    
    if D < 0:
        print("imaginary")
    elif D==0:
        print(-1*b/(2*a))
    else:
        ans=[]
        
        ans.append((-b-D**0.5)/(2*a))
        ans.append((-b+D**0.5)/(2*a))
        
        print(' '.join(map(str, ans)))
        
        


main()
0