結果

問題 No.955 ax^2+bx+c=0
ユーザー 👑 KazunKazun
提出日時 2021-01-01 18:40:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 743 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 82,304 KB
最終ジャッジ日時 2024-04-19 20:01:58
合計ジャッジ時間 20,001 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
79,616 KB
testcase_01 AC 133 ms
79,616 KB
testcase_02 AC 138 ms
80,128 KB
testcase_03 AC 138 ms
79,488 KB
testcase_04 AC 141 ms
79,872 KB
testcase_05 AC 142 ms
80,256 KB
testcase_06 AC 132 ms
79,872 KB
testcase_07 AC 128 ms
79,616 KB
testcase_08 AC 131 ms
79,616 KB
testcase_09 AC 135 ms
79,872 KB
testcase_10 AC 136 ms
79,872 KB
testcase_11 AC 136 ms
79,872 KB
testcase_12 AC 136 ms
79,872 KB
testcase_13 AC 139 ms
79,872 KB
testcase_14 AC 138 ms
79,872 KB
testcase_15 AC 139 ms
79,872 KB
testcase_16 AC 140 ms
79,872 KB
testcase_17 AC 138 ms
79,744 KB
testcase_18 AC 139 ms
79,488 KB
testcase_19 AC 142 ms
80,256 KB
testcase_20 AC 140 ms
79,872 KB
testcase_21 AC 138 ms
79,616 KB
testcase_22 AC 149 ms
79,616 KB
testcase_23 AC 136 ms
79,872 KB
testcase_24 AC 137 ms
79,872 KB
testcase_25 AC 137 ms
79,616 KB
testcase_26 AC 135 ms
79,744 KB
testcase_27 AC 138 ms
80,128 KB
testcase_28 AC 141 ms
79,616 KB
testcase_29 AC 142 ms
79,872 KB
testcase_30 AC 139 ms
80,000 KB
testcase_31 AC 140 ms
79,872 KB
testcase_32 AC 138 ms
79,744 KB
testcase_33 AC 138 ms
79,616 KB
testcase_34 AC 139 ms
79,616 KB
testcase_35 AC 138 ms
80,128 KB
testcase_36 AC 138 ms
79,872 KB
testcase_37 AC 133 ms
79,872 KB
testcase_38 AC 132 ms
80,000 KB
testcase_39 AC 140 ms
79,872 KB
testcase_40 AC 133 ms
79,872 KB
testcase_41 AC 130 ms
79,872 KB
testcase_42 AC 140 ms
80,128 KB
testcase_43 AC 137 ms
79,488 KB
testcase_44 AC 135 ms
79,744 KB
testcase_45 AC 140 ms
79,616 KB
testcase_46 AC 139 ms
79,872 KB
testcase_47 AC 138 ms
79,616 KB
testcase_48 AC 148 ms
79,872 KB
testcase_49 AC 142 ms
79,872 KB
testcase_50 AC 138 ms
79,872 KB
testcase_51 AC 137 ms
79,872 KB
testcase_52 AC 141 ms
80,000 KB
testcase_53 AC 142 ms
80,000 KB
testcase_54 AC 134 ms
79,616 KB
testcase_55 AC 139 ms
79,872 KB
testcase_56 AC 136 ms
79,616 KB
testcase_57 AC 139 ms
80,000 KB
testcase_58 WA -
testcase_59 WA -
testcase_60 AC 136 ms
79,744 KB
testcase_61 AC 123 ms
79,616 KB
testcase_62 WA -
testcase_63 WA -
testcase_64 AC 129 ms
79,872 KB
testcase_65 WA -
testcase_66 AC 128 ms
79,360 KB
testcase_67 WA -
testcase_68 AC 138 ms
79,872 KB
testcase_69 WA -
testcase_70 WA -
testcase_71 AC 142 ms
79,744 KB
testcase_72 AC 133 ms
79,744 KB
testcase_73 WA -
testcase_74 WA -
testcase_75 AC 122 ms
79,744 KB
testcase_76 AC 122 ms
79,872 KB
testcase_77 WA -
testcase_78 WA -
testcase_79 WA -
testcase_80 AC 124 ms
79,744 KB
testcase_81 WA -
testcase_82 AC 136 ms
79,488 KB
testcase_83 AC 145 ms
79,616 KB
testcase_84 AC 136 ms
79,872 KB
testcase_85 AC 144 ms
80,128 KB
testcase_86 AC 128 ms
79,872 KB
testcase_87 AC 128 ms
79,872 KB
testcase_88 AC 130 ms
79,616 KB
testcase_89 AC 128 ms
80,128 KB
testcase_90 AC 117 ms
80,000 KB
testcase_91 AC 131 ms
79,616 KB
testcase_92 AC 128 ms
79,744 KB
testcase_93 AC 119 ms
80,128 KB
testcase_94 AC 133 ms
79,872 KB
testcase_95 AC 125 ms
79,744 KB
testcase_96 AC 127 ms
79,872 KB
testcase_97 AC 119 ms
80,000 KB
testcase_98 AC 126 ms
79,872 KB
testcase_99 AC 134 ms
79,872 KB
testcase_100 AC 126 ms
80,000 KB
testcase_101 AC 123 ms
79,872 KB
testcase_102 AC 136 ms
79,872 KB
testcase_103 AC 128 ms
79,488 KB
testcase_104 AC 126 ms
79,616 KB
testcase_105 AC 132 ms
79,872 KB
testcase_106 AC 137 ms
80,000 KB
testcase_107 AC 124 ms
80,000 KB
testcase_108 AC 137 ms
80,128 KB
testcase_109 AC 123 ms
80,000 KB
testcase_110 AC 123 ms
79,360 KB
testcase_111 AC 118 ms
79,616 KB
testcase_112 AC 131 ms
79,616 KB
testcase_113 AC 128 ms
79,744 KB
testcase_114 AC 124 ms
79,872 KB
testcase_115 AC 123 ms
80,128 KB
testcase_116 AC 125 ms
79,616 KB
testcase_117 AC 124 ms
79,872 KB
testcase_118 AC 114 ms
80,128 KB
testcase_119 AC 132 ms
79,616 KB
testcase_120 AC 130 ms
79,488 KB
testcase_121 AC 123 ms
80,000 KB
testcase_122 WA -
testcase_123 RE -
testcase_124 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt
import decimal

decimal.getcontext().prec=100

a,b,c=map(int,input().split())

if a<0:
    a=-a
    b=-b
    c=-c

if a==0:
    if b==0:
        if c==0:
            print(-1)
        else:
            print(0)
    else:
        b=decimal.Decimal(b)
        c=decimal.Decimal(c)
        print(1)
        print(-c/b)
else:
    D=b*b-4*a*c
    a=decimal.Decimal(a)
    b=decimal.Decimal(b)
    c=decimal.Decimal(c)
    if D<0:
        print(0)
    elif D==0:
        print(1)
        print(-b/(2*a))
    else:
        print(2)
        R=decimal.Decimal(sqrt(D))

        if b>0:
            x=(-b-R)/(2*a)
        else:
            x=(-b+R)/(2*a)

        y=a/(c*x)
        x,y=min(x,y),max(x,y)
        print(x,y,sep="\n")
0