結果

問題 No.1811 EQUIV Ten
ユーザー tassei903tassei903
提出日時 2022-03-11 17:53:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 314 ms / 2,000 ms
コード長 768 bytes
コンパイル時間 1,752 ms
コンパイル使用メモリ 86,424 KB
実行使用メモリ 116,940 KB
最終ジャッジ日時 2023-10-14 01:16:25
合計ジャッジ時間 8,629 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
70,884 KB
testcase_01 AC 72 ms
71,104 KB
testcase_02 AC 87 ms
76,072 KB
testcase_03 AC 73 ms
70,996 KB
testcase_04 AC 74 ms
70,960 KB
testcase_05 AC 70 ms
70,884 KB
testcase_06 AC 72 ms
70,960 KB
testcase_07 AC 72 ms
70,964 KB
testcase_08 AC 73 ms
71,172 KB
testcase_09 AC 72 ms
71,160 KB
testcase_10 AC 73 ms
71,108 KB
testcase_11 AC 277 ms
109,912 KB
testcase_12 AC 289 ms
112,588 KB
testcase_13 AC 307 ms
115,692 KB
testcase_14 AC 309 ms
116,940 KB
testcase_15 AC 314 ms
116,688 KB
testcase_16 AC 72 ms
70,944 KB
testcase_17 AC 81 ms
76,136 KB
testcase_18 AC 83 ms
76,472 KB
testcase_19 AC 80 ms
76,096 KB
testcase_20 AC 95 ms
78,532 KB
testcase_21 AC 98 ms
78,264 KB
testcase_22 AC 83 ms
76,044 KB
testcase_23 AC 168 ms
90,408 KB
testcase_24 AC 102 ms
79,616 KB
testcase_25 AC 84 ms
75,992 KB
testcase_26 AC 148 ms
87,688 KB
testcase_27 AC 87 ms
76,304 KB
testcase_28 AC 74 ms
70,960 KB
testcase_29 AC 80 ms
76,012 KB
testcase_30 AC 272 ms
109,240 KB
testcase_31 AC 90 ms
76,332 KB
testcase_32 AC 105 ms
79,984 KB
testcase_33 AC 107 ms
80,196 KB
testcase_34 AC 268 ms
107,404 KB
testcase_35 AC 147 ms
87,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")

#######################################################################

ans = 0
n = ni()
mod = 10**9+7
if n <= 3:
    print(0)
    exit()

z = 15
dp = [[0 for j in range(16)]for i in range(n+1)]
dp[0][0] = 1
for i in range(n):
    for j in range(16):
        for k in range(2):
            ni = i + 1
            nj = z&((j<<1)|k)
            if nj == 10:
                continue
            dp[ni][nj] += dp[i][j]
            dp[ni][nj] %= mod

print((pow(2,n,mod)-sum(dp[-1]))%mod)
0