結果
| 問題 | No.1179 Quadratic Equation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-21 22:26:54 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 2,000 ms |
| コード長 | 316 bytes |
| 記録 | |
| コンパイル時間 | 141 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 53,888 KB |
| 最終ジャッジ日時 | 2026-05-03 06:05:29 |
| 合計ジャッジ時間 | 1,729 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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])