結果

問題 No.1811 EQUIV Ten
ユーザー 👑 KazunKazun
提出日時 2022-01-14 21:44:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 558 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 77,196 KB
最終ジャッジ日時 2023-08-12 18:47:30
合計ジャッジ時間 4,902 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,380 KB
testcase_01 AC 72 ms
71,488 KB
testcase_02 AC 78 ms
76,156 KB
testcase_03 AC 75 ms
71,352 KB
testcase_04 AC 73 ms
71,312 KB
testcase_05 AC 76 ms
71,256 KB
testcase_06 AC 72 ms
71,376 KB
testcase_07 AC 73 ms
71,348 KB
testcase_08 AC 71 ms
71,320 KB
testcase_09 AC 72 ms
71,568 KB
testcase_10 AC 73 ms
71,356 KB
testcase_11 AC 113 ms
76,752 KB
testcase_12 AC 115 ms
77,108 KB
testcase_13 AC 118 ms
77,136 KB
testcase_14 AC 116 ms
76,800 KB
testcase_15 AC 119 ms
77,004 KB
testcase_16 AC 72 ms
71,576 KB
testcase_17 AC 79 ms
76,608 KB
testcase_18 AC 81 ms
76,688 KB
testcase_19 AC 75 ms
76,344 KB
testcase_20 AC 83 ms
76,732 KB
testcase_21 AC 83 ms
76,676 KB
testcase_22 AC 80 ms
76,828 KB
testcase_23 AC 95 ms
76,756 KB
testcase_24 AC 83 ms
76,712 KB
testcase_25 AC 82 ms
76,744 KB
testcase_26 AC 92 ms
77,020 KB
testcase_27 AC 82 ms
76,572 KB
testcase_28 AC 72 ms
71,256 KB
testcase_29 AC 76 ms
76,308 KB
testcase_30 AC 112 ms
77,064 KB
testcase_31 AC 81 ms
76,572 KB
testcase_32 AC 86 ms
76,520 KB
testcase_33 AC 86 ms
76,648 KB
testcase_34 AC 110 ms
77,196 KB
testcase_35 AC 91 ms
77,024 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