結果

問題 No.53 悪の漸化式
ユーザー 👑 colognecologne
提出日時 2022-01-24 20:07:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 320 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 82,176 KB
最終ジャッジ日時 2024-05-08 16:36:45
合計ジャッジ時間 3,340 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
80,312 KB
testcase_01 AC 110 ms
80,256 KB
testcase_02 AC 112 ms
80,244 KB
testcase_03 AC 116 ms
80,244 KB
testcase_04 AC 113 ms
80,256 KB
testcase_05 AC 112 ms
80,000 KB
testcase_06 AC 110 ms
80,128 KB
testcase_07 AC 110 ms
80,256 KB
testcase_08 AC 111 ms
80,384 KB
testcase_09 AC 113 ms
80,256 KB
testcase_10 AC 114 ms
80,384 KB
testcase_11 AC 115 ms
80,640 KB
testcase_12 AC 113 ms
80,256 KB
testcase_13 AC 116 ms
80,512 KB
testcase_14 AC 118 ms
80,256 KB
testcase_15 AC 122 ms
82,176 KB
testcase_16 AC 122 ms
81,664 KB
testcase_17 AC 128 ms
81,664 KB
testcase_18 AC 133 ms
81,664 KB
testcase_19 AC 131 ms
81,664 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