結果
| 問題 | No.955 ax^2+bx+c=0 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-20 16:28:04 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 438 bytes |
| 記録 | |
| コンパイル時間 | 226 ms |
| コンパイル使用メモリ | 77,768 KB |
| 最終ジャッジ日時 | 2025-12-04 02:03:09 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 99 WA * 23 |
ソースコード
#yuki955 import math import sys a,b,c=map(int,raw_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