結果

問題 No.550 夏休みの思い出(1)
ユーザー realDivineJKrealDivineJK
提出日時 2020-05-26 14:44:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 745 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-21 04:18:15
合計ジャッジ時間 4,252 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 37 ms
10,752 KB
testcase_03 AC 36 ms
10,752 KB
testcase_04 AC 37 ms
10,880 KB
testcase_05 AC 37 ms
10,752 KB
testcase_06 AC 37 ms
10,752 KB
testcase_07 AC 36 ms
10,752 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 36 ms
10,752 KB
testcase_13 AC 38 ms
10,752 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 38 ms
10,880 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 37 ms
10,752 KB
testcase_23 AC 37 ms
10,880 KB
testcase_24 AC 36 ms
10,752 KB
testcase_25 AC 37 ms
10,752 KB
testcase_26 AC 37 ms
10,752 KB
testcase_27 AC 36 ms
10,752 KB
testcase_28 AC 37 ms
10,880 KB
testcase_29 AC 36 ms
10,752 KB
testcase_30 AC 36 ms
10,880 KB
testcase_31 AC 36 ms
10,752 KB
testcase_32 AC 37 ms
10,752 KB
testcase_33 AC 37 ms
10,752 KB
testcase_34 AC 37 ms
10,880 KB
testcase_35 AC 36 ms
10,880 KB
testcase_36 AC 37 ms
10,752 KB
testcase_37 AC 36 ms
10,752 KB
testcase_38 AC 36 ms
10,752 KB
testcase_39 AC 37 ms
10,880 KB
testcase_40 AC 36 ms
10,880 KB
testcase_41 AC 37 ms
10,752 KB
testcase_42 AC 37 ms
10,880 KB
testcase_43 AC 37 ms
10,880 KB
testcase_44 AC 36 ms
10,880 KB
testcase_45 AC 36 ms
10,880 KB
testcase_46 AC 36 ms
10,880 KB
testcase_47 AC 36 ms
10,752 KB
testcase_48 AC 36 ms
10,752 KB
testcase_49 AC 35 ms
10,752 KB
testcase_50 AC 36 ms
10,880 KB
testcase_51 AC 36 ms
10,880 KB
testcase_52 AC 37 ms
10,880 KB
testcase_53 AC 35 ms
10,752 KB
testcase_54 AC 35 ms
10,752 KB
testcase_55 AC 36 ms
10,752 KB
testcase_56 AC 36 ms
10,752 KB
testcase_57 AC 37 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, c = map(int, input().split())
def f(x):
    return x**3 + a*x**2 + b*x + c
def dfdx(x):
    return 3*x**2 + 2*a*x + b
def ddfddx(x):
    return 6*x + 2*a
    
x0, x1 = -a/3 - 1e-7, -a/3 + 1e-7
for i in range(1000):
    if ddfddx(x0) == 0:
        x0 -= 1e-7
    else:
        x0 -= dfdx(x0) / ddfddx(x0)
    if ddfddx(x1) == 0:
        x1 -= 1e-7
    else:
        x1 -= dfdx(x1) / ddfddx(x1)
x0, x1, x2 = x0 - 1e-8, -a/3, x1 + 1e-8
for i in range(1000):
    if dfdx(x0) == 0:
        x0 -= 1e-7
    else:
        x0 -= f(x0) / dfdx(x0)
    if dfdx(x1) == 0:
        x1 -= 1e-7
    else:
        x1 -= f(x1) / dfdx(x1)
    if dfdx(x2) == 0:
        x2 -= 1e-7
    else:
        x2 -= f(x2) / dfdx(x2)
print(round(x0), round(x1), round(x2))
0