結果

問題 No.1179 Quadratic Equation
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-06-14 12:46:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 317 bytes
コンパイル時間 1,459 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 71,488 KB
最終ジャッジ日時 2023-08-25 21:19:19
合計ジャッジ時間 2,559 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

a,b,c=map(int,input().split())
"""
ax**2+bx+c=0
a(x**2+b/ax+b**2/4*a**2)=-c+b**2/4*a
a(x+b/2*a)**2=-c+b**2/4*a
(x+b/2*a)**2=-c/a+b**2/4*a**2

"""
from math import sqrt
tmp=-c/a+b**2/(4*a**2)
if tmp<0:
  print("imaginary")
else:
  tmp=sqrt(tmp)
  if tmp!=0:
    print(tmp-b/(2*a),-tmp-b/(2*a))
  else:
    print(tmp)

0