結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー maine_honzukimaine_honzuki
提出日時 2020-05-07 09:00:38
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 22 ms / 5,000 ms
コード長 487 bytes
コンパイル時間 1,495 ms
コンパイル使用メモリ 164,052 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-16 07:44:22
合計ジャッジ時間 2,134 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
4,380 KB
testcase_01 AC 22 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int basis = 111111;
const ll MOD = 1e9 + 9;

int main() {
    ll dp[100020] = {};
    dp[0] = 1;
    for (int i = 0; i < 10; i++) {
        int t = i;
        if (t == 0)
            t = 1;
        for (int c = 0; c < 100000; c++) {
            (dp[c + t] += dp[c]) %= MOD;
        }
    }

    int T;
    cin >> T;
    while (T--) {
        ll M;
        cin >> M;
        cout << dp[M / basis] << endl;
    }
}
0