結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー motimoti
提出日時 2015-07-16 18:18:02
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 23 ms / 5,000 ms
コード長 553 bytes
コンパイル時間 2,839 ms
コンパイル使用メモリ 73,628 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-22 16:45:09
合計ジャッジ時間 4,304 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <complex>
#include <queue>
#include <set>
#include <map>

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;

ll dp[111111];

//int constexpr MOD = 1e9+7;
int constexpr MOD = 1e9+9;

int main() {

  rep(i, 111111) dp[i] = 1;
  REP(i, 1, 10) REP(j, i, 111111) {
    (dp[j] += dp[j-i]) %= MOD;
  }

  int T;
  cin >> T;
  while(T--) {
    ll M; cin >> M; cout << dp[M/111111] << endl;
  }

  return 0;
}
0