結果

問題 No.1811 EQUIV Ten
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2022-01-14 22:01:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 494 bytes
コンパイル時間 634 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 77,020 KB
最終ジャッジ日時 2023-08-12 19:38:34
合計ジャッジ時間 5,386 ms
ジャッジサーバーID
(参考情報)
judge15 / judge7
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,216 KB
testcase_01 AC 73 ms
71,212 KB
testcase_02 AC 76 ms
71,256 KB
testcase_03 AC 73 ms
71,092 KB
testcase_04 AC 75 ms
71,144 KB
testcase_05 AC 75 ms
71,376 KB
testcase_06 AC 74 ms
71,220 KB
testcase_07 AC 73 ms
71,360 KB
testcase_08 AC 75 ms
71,176 KB
testcase_09 AC 75 ms
71,228 KB
testcase_10 AC 75 ms
71,136 KB
testcase_11 AC 92 ms
76,744 KB
testcase_12 AC 93 ms
76,948 KB
testcase_13 AC 93 ms
76,728 KB
testcase_14 AC 94 ms
76,720 KB
testcase_15 AC 94 ms
76,756 KB
testcase_16 AC 73 ms
71,260 KB
testcase_17 AC 75 ms
71,204 KB
testcase_18 AC 81 ms
76,440 KB
testcase_19 AC 73 ms
71,292 KB
testcase_20 AC 79 ms
76,436 KB
testcase_21 AC 81 ms
76,252 KB
testcase_22 AC 79 ms
76,260 KB
testcase_23 AC 83 ms
76,508 KB
testcase_24 AC 82 ms
76,436 KB
testcase_25 AC 80 ms
76,656 KB
testcase_26 AC 84 ms
76,572 KB
testcase_27 AC 79 ms
76,256 KB
testcase_28 AC 73 ms
71,216 KB
testcase_29 AC 76 ms
70,996 KB
testcase_30 AC 93 ms
77,020 KB
testcase_31 AC 81 ms
76,328 KB
testcase_32 AC 81 ms
76,600 KB
testcase_33 AC 81 ms
76,252 KB
testcase_34 AC 93 ms
76,820 KB
testcase_35 AC 86 ms
76,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

2進数表記に 1010を含む


"""

N = int(input())

mod = 10**9+7

dp = [1,0,0,0]

for i in range(N):

    ndp = [0,0,0,0]

    #ok
    ndp[1] += dp[0] #1を置く
    ndp[0] += dp[0] #0

    #1
    ndp[1] += dp[1] #1を置く
    ndp[2] += dp[1] #0

    #2 = 10
    ndp[3] += dp[2] #1
    ndp[0] += dp[2] #0

    #3 = 101
    ndp[1] += dp[3] #1
    #0は禁止

    for j in range(4):
        ndp[j] %= mod
    dp = ndp

ng = sum(dp) % mod

ans = pow(2,N,mod) - ng
print (ans % mod)
0