結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー mayoko_mayoko_
提出日時 2015-11-07 13:10:10
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 21 ms / 5,000 ms
コード長 1,129 bytes
コンパイル時間 617 ms
コンパイル使用メモリ 76,712 KB
実行使用メモリ 10,524 KB
最終ジャッジ日時 2023-10-11 15:02:23
合計ジャッジ時間 1,100 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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;
    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;;
        }
    }
    while (T--) {
        ll M;
        cin >> M;
        ll tar = M/ZORO;
        cout << dp[9][tar] << endl;
    }
    return 0;
}
0