結果
| 問題 | No.1179 Quadratic Equation |
| コンテスト | |
| ユーザー |
r_ishida
|
| 提出日時 | 2026-03-12 07:36:35 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 2,000 ms |
| コード長 | 526 bytes |
| 記録 | |
| コンパイル時間 | 306 ms |
| コンパイル使用メモリ | 85,168 KB |
| 実行使用メモリ | 52,608 KB |
| 最終ジャッジ日時 | 2026-03-12 07:36:43 |
| 合計ジャッジ時間 | 1,523 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
ソースコード
import math
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a,b,c = MI()
p = b**2-4*a*c
if p < 0:
print("imaginary")
elif p == 0:
print(-b/(2*a))
elif a > 0:
print((-b-p**0.5)/(2*a), (-b+p**0.5)/(2*a))
else:
print((-b+p**0.5)/(2*a), (-b-p**0.5)/(2*a))
r_ishida