結果
| 問題 | No.41 貯金箱の溜息(EASY) | 
| コンテスト | |
| ユーザー |  mayoko_ | 
| 提出日時 | 2015-11-07 13:10:10 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 20 ms / 5,000 ms | 
| コード長 | 1,129 bytes | 
| コンパイル時間 | 617 ms | 
| コンパイル使用メモリ | 85,164 KB | 
| 実行使用メモリ | 10,664 KB | 
| 最終ジャッジ日時 | 2024-09-13 13:53:59 | 
| 合計ジャッジ時間 | 1,058 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 2 | 
ソースコード
#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;
}
            
            
            
        