結果
| 問題 |
No.1179 Quadratic Equation
|
| コンテスト | |
| ユーザー |
uni_python
|
| 提出日時 | 2020-08-21 22:19:45 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 40 ms / 2,000 ms |
| コード長 | 549 bytes |
| コンパイル時間 | 165 ms |
| コンパイル使用メモリ | 82,412 KB |
| 実行使用メモリ | 52,608 KB |
| 最終ジャッジ日時 | 2024-10-15 05:50:17 |
| 合計ジャッジ時間 | 1,332 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
ソースコード
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()
if a<0:
a*=-1
b*=-1
c*=-1
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()
uni_python