結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー koba-e964koba-e964
提出日時 2015-06-04 20:35:00
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 25 ms / 5,000 ms
コード長 739 bytes
コンパイル時間 451 ms
コンパイル使用メモリ 66,788 KB
実行使用メモリ 11,200 KB
最終ジャッジ日時 2023-09-20 19:10:15
合計ジャッジ時間 927 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <bitset>
#include <cassert>
#include <deque>
#include <functional>
#include <iostream>
#include <string>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef pair<int, int> PI;
const double EPS=1e-9;

const ll mod = 1e9 + 9;

const int N = 10, M = 100000;

ll dp[N][M];
int main(void){
  int t;
  cin >> t;
  REP(j, 0, M) {
    dp[0][j] = 1;
  }
  REP (i, 1, N) {
    REP(j, 0, M) {
      ll s = 0;
      if (j >= i) {
	s += dp[i][j - i];
      }
      s += dp[i - 1][j];
      s %= mod;
      dp[i][j] = s;
    }
  }
  REP (trial, 0, t) {
    ll m;
    cin >> m;
    cout << dp[9][m / 111111] << endl;
  }
}
0