結果

問題 No.53 悪の漸化式
ユーザー rlangevinrlangevin
提出日時 2023-10-27 01:21:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 228 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 81,832 KB
実行使用メモリ 80,552 KB
最終ジャッジ日時 2023-10-27 01:21:39
合計ジャッジ時間 4,032 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
79,276 KB
testcase_01 AC 121 ms
79,280 KB
testcase_02 AC 116 ms
79,280 KB
testcase_03 AC 116 ms
79,276 KB
testcase_04 AC 118 ms
79,280 KB
testcase_05 AC 119 ms
79,280 KB
testcase_06 AC 116 ms
79,276 KB
testcase_07 AC 118 ms
79,280 KB
testcase_08 AC 124 ms
79,280 KB
testcase_09 AC 120 ms
79,276 KB
testcase_10 AC 119 ms
79,276 KB
testcase_11 AC 124 ms
79,276 KB
testcase_12 AC 119 ms
79,280 KB
testcase_13 AC 121 ms
79,276 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import *

N = int(input())
if N == 0:
    print(4)
elif N == 1:
    print(3)
else:
    a0, a1 = Decimal(4), Decimal(3)
    for i in range(N - 1):
        a2 = a1 * 19/4 - 3 * a0
        a1, a0 = a2, a1
    print(a2)
0