結果

問題 No.1811 EQUIV Ten
ユーザー se1ka2se1ka2
提出日時 2022-01-14 22:02:20
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 566 bytes
コンパイル時間 760 ms
コンパイル使用メモリ 64,120 KB
実行使用メモリ 34,660 KB
最終ジャッジ日時 2023-08-12 19:39:37
合計ジャッジ時間 2,272 ms
ジャッジサーバーID
(参考情報)
judge15 / judge8
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,384 KB
testcase_11 AC 39 ms
29,548 KB
testcase_12 AC 42 ms
31,628 KB
testcase_13 AC 46 ms
33,844 KB
testcase_14 AC 46 ms
34,660 KB
testcase_15 AC 47 ms
34,636 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 4 ms
4,692 KB
testcase_21 AC 4 ms
4,632 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 17 ms
14,020 KB
testcase_24 AC 5 ms
5,400 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 14 ms
11,884 KB
testcase_27 AC 2 ms
4,384 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 38 ms
28,612 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 6 ms
5,736 KB
testcase_33 AC 6 ms
5,836 KB
testcase_34 AC 37 ms
27,220 KB
testcase_35 AC 14 ms
11,940 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