結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー h_nosonh_noson
提出日時 2016-04-14 16:23:20
言語 C++11
(gcc 8.5.0)
結果
AC  
実行時間 72 ms / 5,000 ms
コード長 658 bytes
コンパイル時間 360 ms
実行使用メモリ 42,500 KB
最終ジャッジ日時 2022-11-27 18:42:42
合計ジャッジ時間 1,314 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
42,500 KB
testcase_01 AC 70 ms
42,488 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