結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー koba-e964koba-e964
提出日時 2015-06-04 20:34:09
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 738 bytes
コンパイル時間 740 ms
コンパイル使用メモリ 67,104 KB
実行使用メモリ 4,412 KB
最終ジャッジ日時 2023-09-20 19:10:13
合計ジャッジ時間 1,916 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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 = 10000;

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