結果

問題 No.955 ax^2+bx+c=0
ユーザー koyoprokoyopro
提出日時 2020-01-25 13:35:08
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 675 bytes
コンパイル時間 1,860 ms
コンパイル使用メモリ 77,576 KB
実行使用メモリ 81,632 KB
最終ジャッジ日時 2023-10-12 04:33:56
合計ジャッジ時間 23,189 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
81,200 KB
testcase_01 AC 143 ms
81,252 KB
testcase_02 AC 138 ms
81,252 KB
testcase_03 AC 138 ms
81,200 KB
testcase_04 AC 136 ms
81,492 KB
testcase_05 AC 139 ms
81,380 KB
testcase_06 AC 139 ms
81,384 KB
testcase_07 AC 139 ms
81,452 KB
testcase_08 AC 140 ms
81,520 KB
testcase_09 AC 136 ms
81,440 KB
testcase_10 AC 140 ms
81,464 KB
testcase_11 AC 140 ms
81,400 KB
testcase_12 AC 143 ms
81,396 KB
testcase_13 AC 140 ms
81,432 KB
testcase_14 AC 139 ms
81,376 KB
testcase_15 AC 140 ms
81,408 KB
testcase_16 AC 135 ms
81,412 KB
testcase_17 AC 139 ms
81,268 KB
testcase_18 AC 141 ms
81,288 KB
testcase_19 AC 138 ms
81,364 KB
testcase_20 AC 139 ms
81,456 KB
testcase_21 AC 137 ms
81,376 KB
testcase_22 AC 139 ms
81,372 KB
testcase_23 AC 140 ms
81,464 KB
testcase_24 AC 138 ms
81,492 KB
testcase_25 AC 138 ms
81,204 KB
testcase_26 AC 137 ms
81,432 KB
testcase_27 AC 137 ms
81,520 KB
testcase_28 AC 139 ms
81,348 KB
testcase_29 AC 136 ms
81,428 KB
testcase_30 AC 146 ms
81,252 KB
testcase_31 AC 141 ms
81,384 KB
testcase_32 AC 140 ms
81,380 KB
testcase_33 AC 141 ms
81,272 KB
testcase_34 AC 137 ms
81,412 KB
testcase_35 AC 137 ms
81,264 KB
testcase_36 AC 138 ms
81,480 KB
testcase_37 AC 138 ms
81,436 KB
testcase_38 AC 140 ms
81,436 KB
testcase_39 AC 139 ms
81,436 KB
testcase_40 AC 137 ms
81,508 KB
testcase_41 AC 144 ms
81,492 KB
testcase_42 AC 139 ms
81,380 KB
testcase_43 AC 138 ms
81,204 KB
testcase_44 AC 136 ms
81,352 KB
testcase_45 AC 141 ms
81,348 KB
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 AC 138 ms
81,168 KB
testcase_59 WA -
testcase_60 AC 138 ms
81,512 KB
testcase_61 AC 136 ms
81,456 KB
testcase_62 AC 137 ms
81,412 KB
testcase_63 WA -
testcase_64 AC 140 ms
81,420 KB
testcase_65 WA -
testcase_66 AC 139 ms
81,324 KB
testcase_67 AC 136 ms
81,288 KB
testcase_68 AC 137 ms
81,136 KB
testcase_69 AC 139 ms
81,524 KB
testcase_70 WA -
testcase_71 AC 140 ms
81,408 KB
testcase_72 AC 138 ms
81,592 KB
testcase_73 AC 139 ms
81,464 KB
testcase_74 AC 137 ms
81,248 KB
testcase_75 AC 140 ms
81,420 KB
testcase_76 AC 140 ms
81,408 KB
testcase_77 WA -
testcase_78 WA -
testcase_79 WA -
testcase_80 AC 137 ms
81,516 KB
testcase_81 AC 136 ms
81,144 KB
testcase_82 AC 138 ms
81,496 KB
testcase_83 AC 131 ms
81,288 KB
testcase_84 AC 129 ms
81,140 KB
testcase_85 AC 129 ms
81,244 KB
testcase_86 AC 132 ms
81,412 KB
testcase_87 AC 132 ms
81,516 KB
testcase_88 AC 132 ms
81,216 KB
testcase_89 AC 138 ms
81,256 KB
testcase_90 AC 141 ms
81,400 KB
testcase_91 AC 138 ms
81,080 KB
testcase_92 AC 140 ms
81,408 KB
testcase_93 AC 137 ms
81,404 KB
testcase_94 AC 142 ms
81,344 KB
testcase_95 AC 138 ms
81,412 KB
testcase_96 AC 138 ms
81,464 KB
testcase_97 AC 138 ms
81,468 KB
testcase_98 AC 140 ms
81,248 KB
testcase_99 AC 137 ms
81,272 KB
testcase_100 AC 137 ms
81,496 KB
testcase_101 AC 139 ms
81,468 KB
testcase_102 AC 137 ms
81,140 KB
testcase_103 AC 137 ms
81,512 KB
testcase_104 AC 135 ms
81,540 KB
testcase_105 AC 135 ms
81,560 KB
testcase_106 AC 135 ms
81,512 KB
testcase_107 AC 135 ms
81,528 KB
testcase_108 AC 137 ms
81,144 KB
testcase_109 AC 134 ms
81,380 KB
testcase_110 AC 134 ms
81,140 KB
testcase_111 AC 136 ms
81,332 KB
testcase_112 AC 133 ms
81,200 KB
testcase_113 AC 134 ms
81,516 KB
testcase_114 AC 136 ms
81,416 KB
testcase_115 AC 136 ms
81,272 KB
testcase_116 AC 136 ms
81,488 KB
testcase_117 AC 136 ms
81,416 KB
testcase_118 AC 133 ms
81,272 KB
testcase_119 AC 135 ms
81,560 KB
testcase_120 AC 136 ms
81,416 KB
testcase_121 AC 134 ms
81,344 KB
testcase_122 AC 133 ms
81,432 KB
testcase_123 AC 136 ms
81,284 KB
testcase_124 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import *

a,b,c = [Decimal(int(x)) for x in raw_input().split()]

def solve():
    if (a==0 and b==0):
        print(-1 if (c==0) else 0)
        return

    if (a==0):
        print(1)
        ans = -c/b
        print("{:.16f}".format(ans))
        return

    border = Decimal(b*b - 4 * a * c)
    if (border < 0):
        print(0)
        return

    if (border == 0):
        print(1)
        ans = -b / Decimal(2) / a
        print("{:.16f}".format(ans))
        return

    q = border.sqrt()
    ans0 = (-b + q) / Decimal(2) / a
    ans1 = (-b - q) / Decimal(2) / a
    print(2)
    print("{:.16f}".format(ans1))
    print("{:.16f}".format(ans0))

solve()
0