結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー mayoko_mayoko_
提出日時 2015-11-07 13:09:16
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,192 bytes
コンパイル時間 1,410 ms
コンパイル使用メモリ 76,644 KB
実行使用メモリ 15,576 KB
最終ジャッジ日時 2023-10-11 15:01:09
合計ジャッジ時間 13,215 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
//#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
//#include<list>
#include<queue>
#include<deque>
#include<algorithm>
//#include<numeric>
#include<utility>
#include<complex>
//#include<memory>
#include<functional>
#include<cassert>
#include<set>
#include<stack>

const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;

const ll ZORO = 111111;
const ll MAX = 10000000000ll/ZORO + 10;
const ll MOD = 1e9+9;

ll dp[11][MAX];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int T;
    cin >> T;
    while (T--) {
        ll M;
        cin >> M;
        ll tar = M/ZORO;
        memset(dp, 0, sizeof(dp));
        for (int i = 0; i < MAX; i++) dp[0][i] = 1;
        for (int i = 1; i <= 9; i++) {
            for (int j = 0; j < MAX; j++) {
                dp[i][j] = dp[i-1][j];
                if (j-i >= 0) (dp[i][j] += dp[i][j-i]) %= MOD;;
            }
        }
        cout << dp[9][tar] << endl;
    }
    return 0;
}
0