結果
| 問題 | No.955 ax^2+bx+c=0 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-20 16:44:30 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0) |
| 結果 |
AC
|
| 実行時間 | 97 ms / 2,000 ms |
| + 92µs | |
| コード長 | 446 bytes |
| 記録 | |
| コンパイル時間 | 291 ms |
| コンパイル使用メモリ | 21,536 KB |
| 実行使用メモリ | 15,996 KB |
| 最終ジャッジ日時 | 2026-08-30 12:40:54 |
| 合計ジャッジ時間 | 16,258 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 122 |
ソースコード
#yuki955 import math import sys a,b,c=map(int,input().split()) if a==0 and b==0 and c==0: print(-1) sys.exit() if a==0 and b==0: print(0) sys.exit() if a==0: print(1) print(-c/b) sys.exit() D=b**2-4*a*c if D<0: print(0) sys.exit() if D==0: print(1) print(-b/(2*a)) sys.exit() print(2) if b<0: a,b,c=-a,-b,-c x1=(-b-math.sqrt(D))/(2*a) x2=(b**2-D)/(2*a)/(-b-math.sqrt(D)) if a>0: print(x1) print(x2) else: print(x2) print(x1)