結果

問題 No.1811 EQUIV Ten
ユーザー 👑 KazunKazun
提出日時 2022-01-14 21:44:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 82,708 KB
実行使用メモリ 76,384 KB
最終ジャッジ日時 2024-04-30 13:52:40
合計ジャッジ時間 2,735 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,668 KB
testcase_01 AC 32 ms
53,164 KB
testcase_02 AC 37 ms
59,892 KB
testcase_03 AC 32 ms
53,080 KB
testcase_04 AC 33 ms
52,640 KB
testcase_05 AC 33 ms
52,512 KB
testcase_06 AC 33 ms
52,432 KB
testcase_07 AC 33 ms
52,196 KB
testcase_08 AC 33 ms
52,952 KB
testcase_09 AC 33 ms
53,972 KB
testcase_10 AC 33 ms
52,544 KB
testcase_11 AC 73 ms
75,768 KB
testcase_12 AC 79 ms
75,776 KB
testcase_13 AC 80 ms
76,384 KB
testcase_14 AC 78 ms
75,780 KB
testcase_15 AC 79 ms
76,008 KB
testcase_16 AC 33 ms
52,124 KB
testcase_17 AC 39 ms
61,308 KB
testcase_18 AC 41 ms
61,660 KB
testcase_19 AC 36 ms
59,604 KB
testcase_20 AC 42 ms
65,476 KB
testcase_21 AC 44 ms
66,060 KB
testcase_22 AC 41 ms
61,784 KB
testcase_23 AC 59 ms
75,864 KB
testcase_24 AC 46 ms
69,472 KB
testcase_25 AC 40 ms
62,196 KB
testcase_26 AC 56 ms
76,172 KB
testcase_27 AC 44 ms
62,756 KB
testcase_28 AC 33 ms
52,952 KB
testcase_29 AC 37 ms
59,776 KB
testcase_30 AC 74 ms
76,112 KB
testcase_31 AC 42 ms
64,768 KB
testcase_32 AC 45 ms
69,024 KB
testcase_33 AC 47 ms
70,008 KB
testcase_34 AC 71 ms
75,924 KB
testcase_35 AC 56 ms
75,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
Mod=10**9+7

DP=[0]*16; DP[0]=1
Ans=0

for _ in range(N):
    E=DP.copy()
    DP=[0]*16

    for i in range(16):
        p=(i<<1)&15
        DP[p]+=E[i]
        DP[p+1]+=E[i]

    for i in range(16):
        DP[i]%=Mod

    Ans=(2*Ans+DP[10])%Mod
    DP[10]=0

print(Ans)
0