結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー h_nosonh_noson
提出日時 2016-04-14 16:23:20
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 53 ms / 5,000 ms
コード長 658 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 59,768 KB
実行使用メモリ 42,468 KB
最終ジャッジ日時 2024-04-15 01:25:35
合計ジャッジ時間 1,064 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define RREP(i,s,e) for (i = s; i >= e; i--)
#define rrep(i,n) RREP(i,n,0)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 100000000
#define MOD 1000000009

typedef long long ll;

int dp[10][1000000];

int main() {
    int i, j, t;
    cin >> t;
    fill(dp[0],dp[0]+1000000,1);
    REP (i,1,10) {
        rep (j,1000000) {
            dp[i][j] = dp[i-1][j] + (i <= j ? dp[i][j-i] : 0);
            dp[i][j] %= MOD;
        }
    }
    rep (i,t) {
        ll m;
        cin >> m;
        cout << dp[9][m/111111] << endl;
    }
    return 0;
}
0