結果

問題 No.1179 Quadratic Equation
ユーザー persimmon-persimmon
提出日時 2021-06-14 12:46:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 317 bytes
コンパイル時間 1,015 ms
コンパイル使用メモリ 82,312 KB
実行使用メモリ 54,484 KB
最終ジャッジ日時 2024-12-24 07:36:55
合計ジャッジ時間 1,542 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 2 WA * 9
権限があれば一括ダウンロードができます

ソースコード

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