結果

問題 No.1811 EQUIV Ten
ユーザー roarisroaris
提出日時 2022-02-14 16:34:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 190 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 77,212 KB
最終ジャッジ日時 2023-09-11 16:43:56
合計ジャッジ時間 5,477 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,508 KB
testcase_01 AC 69 ms
71,556 KB
testcase_02 AC 78 ms
76,384 KB
testcase_03 AC 70 ms
71,136 KB
testcase_04 AC 68 ms
71,316 KB
testcase_05 AC 68 ms
71,328 KB
testcase_06 AC 68 ms
71,200 KB
testcase_07 AC 70 ms
71,136 KB
testcase_08 AC 70 ms
71,360 KB
testcase_09 AC 70 ms
71,312 KB
testcase_10 AC 68 ms
71,300 KB
testcase_11 AC 171 ms
77,020 KB
testcase_12 AC 179 ms
76,980 KB
testcase_13 AC 187 ms
76,776 KB
testcase_14 AC 190 ms
77,212 KB
testcase_15 AC 189 ms
77,088 KB
testcase_16 AC 67 ms
71,204 KB
testcase_17 AC 77 ms
76,624 KB
testcase_18 AC 77 ms
76,536 KB
testcase_19 AC 74 ms
76,336 KB
testcase_20 AC 79 ms
76,540 KB
testcase_21 AC 79 ms
76,680 KB
testcase_22 AC 76 ms
76,592 KB
testcase_23 AC 117 ms
76,964 KB
testcase_24 AC 87 ms
76,892 KB
testcase_25 AC 78 ms
76,472 KB
testcase_26 AC 107 ms
76,764 KB
testcase_27 AC 77 ms
76,512 KB
testcase_28 AC 69 ms
71,608 KB
testcase_29 AC 74 ms
76,412 KB
testcase_30 AC 169 ms
76,940 KB
testcase_31 AC 78 ms
76,524 KB
testcase_32 AC 86 ms
76,952 KB
testcase_33 AC 86 ms
76,956 KB
testcase_34 AC 162 ms
77,028 KB
testcase_35 AC 107 ms
76,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

if N<=3:
    exit(print(0))

dp = [1]*16
dp[10] = 0
MOD = 10**9+7

for _ in range(N-4):
    ndp = [0]*16
    
    for S in range(16):
        for i in range(2):
            nS = S//2+8*i
            
            if nS!=10:
                ndp[nS] += dp[S]
                ndp[nS] %= MOD
    
    dp = ndp

print((pow(2, N, MOD)-sum(dp))%MOD)
0