結果
| 問題 |
No.1179 Quadratic Equation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-21 22:26:54 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 45 ms / 2,000 ms |
| コード長 | 316 bytes |
| コンパイル時間 | 153 ms |
| コンパイル使用メモリ | 82,140 KB |
| 実行使用メモリ | 54,016 KB |
| 最終ジャッジ日時 | 2024-10-15 05:54:32 |
| 合計ジャッジ時間 | 1,366 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
ソースコード
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])