結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,600 KB
testcase_01 AC 35 ms
53,080 KB
testcase_02 AC 40 ms
60,356 KB
testcase_03 AC 32 ms
52,716 KB
testcase_04 AC 33 ms
53,196 KB
testcase_05 AC 35 ms
52,804 KB
testcase_06 AC 32 ms
53,756 KB
testcase_07 AC 32 ms
52,456 KB
testcase_08 AC 31 ms
52,580 KB
testcase_09 AC 33 ms
53,488 KB
testcase_10 AC 33 ms
53,228 KB
testcase_11 AC 91 ms
75,888 KB
testcase_12 AC 104 ms
75,872 KB
testcase_13 AC 100 ms
75,860 KB
testcase_14 AC 102 ms
76,092 KB
testcase_15 AC 103 ms
76,156 KB
testcase_16 AC 33 ms
54,044 KB
testcase_17 AC 37 ms
60,796 KB
testcase_18 AC 40 ms
60,708 KB
testcase_19 AC 37 ms
60,600 KB
testcase_20 AC 44 ms
69,928 KB
testcase_21 AC 43 ms
68,104 KB
testcase_22 AC 37 ms
60,456 KB
testcase_23 AC 63 ms
75,996 KB
testcase_24 AC 44 ms
73,816 KB
testcase_25 AC 38 ms
60,880 KB
testcase_26 AC 61 ms
76,040 KB
testcase_27 AC 49 ms
63,280 KB
testcase_28 AC 33 ms
53,456 KB
testcase_29 AC 38 ms
60,404 KB
testcase_30 AC 89 ms
75,964 KB
testcase_31 AC 42 ms
64,996 KB
testcase_32 AC 47 ms
75,780 KB
testcase_33 AC 48 ms
76,188 KB
testcase_34 AC 90 ms
76,072 KB
testcase_35 AC 61 ms
75,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N = int(input())
    dp = [0] * 16
    dp[0] = 1
    for _ in range(N):
        dp_new = [0] * 16
        for state in range(16):
            state_new0 = (state << 1) % 16
            state_new1 = state_new0 + 1
            if state_new0 != 10:
                dp_new[state_new0] = (dp_new[state_new0] + dp[state])%mod
            dp_new[state_new1] = (dp_new[state_new1] + dp[state]) % mod
        dp = dp_new
    print((pow(2, N, mod) - (sum(dp) % mod))%mod)


if __name__ == '__main__':
    main()
0