結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー kyunakyuna
提出日時 2019-08-09 00:00:30
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 21 ms / 5,000 ms
コード長 456 bytes
コンパイル時間 540 ms
コンパイル使用メモリ 70,524 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-26 01:51:07
合計ジャッジ時間 1,179 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const int MOD = (int)1e9 + 9;

int main() {
    const int ZORO = 111111;
    const int MAX = 1e10 / ZORO;
    vector<int> dp(MAX + 1, 1);
    for (int i = 1; i <= 9; i++) {
        for (int j = i; j <= MAX; j++) (dp[j] += dp[j - i]) %= MOD;
    }
    int T; cin >> T;
    while (T--) {
        long long M; cin >> M;
        cout << dp[M / ZORO] << endl;
    }
    return 0;
}
0