結果

問題 No.1179 Quadratic Equation
ユーザー roarisroaris
提出日時 2020-08-21 22:26:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 82,416 KB
実行使用メモリ 55,640 KB
最終ジャッジ日時 2024-04-23 06:07:46
合計ジャッジ時間 1,189 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
54,380 KB
testcase_01 AC 38 ms
55,128 KB
testcase_02 AC 37 ms
54,116 KB
testcase_03 AC 36 ms
53,812 KB
testcase_04 AC 36 ms
55,640 KB
testcase_05 AC 36 ms
54,148 KB
testcase_06 AC 36 ms
54,320 KB
testcase_07 AC 38 ms
53,864 KB
testcase_08 AC 41 ms
54,572 KB
testcase_09 AC 38 ms
54,344 KB
testcase_10 AC 38 ms
54,584 KB
testcase_11 AC 37 ms
54,612 KB
testcase_12 AC 36 ms
54,280 KB
testcase_13 AC 34 ms
54,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

a, b, c = map(int, input().split())

if b*b-4*a*c<0:
    print('imaginary')
else:
    if b*b-4*a*c==0:
        print(-b/2/a)
    else:
        d = (b*b-4*a*c)**0.5
        ans = [(-b-d)/2/a, (-b+d)/2/a]
        ans.sort()
        print(ans[0], ans[1])
0