結果

問題 No.1811 EQUIV Ten
ユーザー 👑 tamatotamato
提出日時 2022-01-14 21:44:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 597 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 87,588 KB
実行使用メモリ 77,368 KB
最終ジャッジ日時 2023-08-12 18:46:54
合計ジャッジ時間 5,238 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,732 KB
testcase_01 AC 71 ms
71,892 KB
testcase_02 AC 79 ms
76,620 KB
testcase_03 AC 75 ms
71,880 KB
testcase_04 AC 72 ms
71,848 KB
testcase_05 AC 73 ms
71,600 KB
testcase_06 AC 73 ms
71,780 KB
testcase_07 AC 72 ms
71,664 KB
testcase_08 AC 72 ms
71,784 KB
testcase_09 AC 72 ms
71,944 KB
testcase_10 AC 75 ms
71,520 KB
testcase_11 AC 136 ms
77,168 KB
testcase_12 AC 139 ms
77,368 KB
testcase_13 AC 144 ms
77,120 KB
testcase_14 AC 149 ms
76,908 KB
testcase_15 AC 146 ms
77,240 KB
testcase_16 AC 69 ms
71,632 KB
testcase_17 AC 77 ms
76,784 KB
testcase_18 AC 76 ms
76,492 KB
testcase_19 AC 75 ms
76,488 KB
testcase_20 AC 80 ms
76,780 KB
testcase_21 AC 79 ms
76,876 KB
testcase_22 AC 78 ms
76,508 KB
testcase_23 AC 101 ms
77,164 KB
testcase_24 AC 84 ms
77,092 KB
testcase_25 AC 78 ms
76,752 KB
testcase_26 AC 97 ms
77,196 KB
testcase_27 AC 77 ms
76,532 KB
testcase_28 AC 72 ms
71,900 KB
testcase_29 AC 76 ms
76,756 KB
testcase_30 AC 131 ms
76,892 KB
testcase_31 AC 78 ms
76,868 KB
testcase_32 AC 83 ms
76,920 KB
testcase_33 AC 84 ms
76,900 KB
testcase_34 AC 130 ms
77,028 KB
testcase_35 AC 96 ms
77,168 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