結果

問題 No.53 悪の漸化式
ユーザー 👑 colognecologne
提出日時 2022-01-24 20:07:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 248 ms / 5,000 ms
コード長 320 bytes
コンパイル時間 583 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 91,552 KB
最終ジャッジ日時 2023-08-21 11:18:10
合計ジャッジ時間 6,330 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 220 ms
88,992 KB
testcase_01 AC 223 ms
88,932 KB
testcase_02 AC 223 ms
89,032 KB
testcase_03 AC 221 ms
89,032 KB
testcase_04 AC 224 ms
89,104 KB
testcase_05 AC 223 ms
88,768 KB
testcase_06 AC 223 ms
88,684 KB
testcase_07 AC 221 ms
89,048 KB
testcase_08 AC 223 ms
88,928 KB
testcase_09 AC 223 ms
88,764 KB
testcase_10 AC 223 ms
88,892 KB
testcase_11 AC 226 ms
89,320 KB
testcase_12 AC 231 ms
91,268 KB
testcase_13 AC 229 ms
91,400 KB
testcase_14 AC 232 ms
91,252 KB
testcase_15 AC 232 ms
91,368 KB
testcase_16 AC 245 ms
91,228 KB
testcase_17 AC 240 ms
91,552 KB
testcase_18 AC 238 ms
91,344 KB
testcase_19 AC 248 ms
91,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import decimal


def input(): return sys.stdin.readline().rstrip()


def main():
    decimal.getcontext().prec = 100
    A = [decimal.Decimal(4), decimal.Decimal(3)]
    N = int(input())
    for i in range(N-1):
        A.append((19*A[-1]-12*A[-2])/4)

    print(A[N])


if __name__ == '__main__':
    main()
0