結果

問題 No.1811 EQUIV Ten
ユーザー se1ka2se1ka2
提出日時 2022-01-14 22:02:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 566 bytes
コンパイル時間 568 ms
コンパイル使用メモリ 64,708 KB
実行使用メモリ 34,688 KB
最終ジャッジ日時 2024-04-30 14:44:40
合計ジャッジ時間 1,701 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 34 ms
29,440 KB
testcase_12 AC 35 ms
31,488 KB
testcase_13 AC 38 ms
33,920 KB
testcase_14 AC 39 ms
34,688 KB
testcase_15 AC 40 ms
34,688 KB
testcase_16 AC 1 ms
6,944 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 2 ms
6,940 KB
testcase_20 AC 3 ms
6,940 KB
testcase_21 AC 4 ms
6,944 KB
testcase_22 AC 2 ms
6,944 KB
testcase_23 AC 15 ms
14,080 KB
testcase_24 AC 5 ms
6,944 KB
testcase_25 AC 2 ms
6,940 KB
testcase_26 AC 12 ms
12,032 KB
testcase_27 AC 2 ms
6,940 KB
testcase_28 AC 2 ms
6,940 KB
testcase_29 AC 2 ms
6,940 KB
testcase_30 AC 33 ms
28,672 KB
testcase_31 AC 2 ms
6,944 KB
testcase_32 AC 4 ms
6,940 KB
testcase_33 AC 4 ms
6,940 KB
testcase_34 AC 31 ms
27,264 KB
testcase_35 AC 12 ms
11,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;

ll dp[200005][20];

int main()
{
    int n;
    cin >> n;
    dp[0][0] = 1;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < 16; j++){
            if(j == 10) dp[i + 1][j] = (dp[i + 1][j] + dp[i][j] * 2) % MOD;
            else{
                dp[i + 1][j * 2 % 16] = (dp[i + 1][j * 2 % 16] + dp[i][j]) % MOD;
                dp[i + 1][j * 2 % 16 + 1] = (dp[i + 1][j * 2 % 16 + 1] + dp[i][j]) % MOD;
            }
        }
    }
    cout << dp[n][10] << endl;
}
0