結果

問題 No.53 悪の漸化式
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-10-12 05:57:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 5,000 ms
コード長 274 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 86,584 KB
実行使用メモリ 73,028 KB
最終ジャッジ日時 2023-09-08 06:13:15
合計ジャッジ時間 4,351 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
72,976 KB
testcase_01 AC 102 ms
72,600 KB
testcase_02 AC 104 ms
72,952 KB
testcase_03 AC 103 ms
72,692 KB
testcase_04 AC 102 ms
72,768 KB
testcase_05 AC 101 ms
72,852 KB
testcase_06 AC 99 ms
72,608 KB
testcase_07 AC 100 ms
72,908 KB
testcase_08 AC 98 ms
72,764 KB
testcase_09 AC 102 ms
72,508 KB
testcase_10 AC 104 ms
72,584 KB
testcase_11 AC 105 ms
72,748 KB
testcase_12 AC 102 ms
72,844 KB
testcase_13 AC 102 ms
72,908 KB
testcase_14 AC 103 ms
73,028 KB
testcase_15 AC 102 ms
72,892 KB
testcase_16 AC 100 ms
72,836 KB
testcase_17 AC 102 ms
72,972 KB
testcase_18 AC 101 ms
72,612 KB
testcase_19 AC 108 ms
72,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline
N = int(input())
B = [0]*(101)
B[0] = 4
B[1] = 12
for i in range(2,N+1):
    B[i] = 19*B[i-1] - 48*B[i-2]

ans = B[N]/pow(4,N)
print(ans)
0