結果
| 問題 |
No.41 貯金箱の溜息(EASY)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-04 20:35:00 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 23 ms / 5,000 ms |
| コード長 | 739 bytes |
| コンパイル時間 | 438 ms |
| コンパイル使用メモリ | 66,424 KB |
| 実行使用メモリ | 11,108 KB |
| 最終ジャッジ日時 | 2024-07-06 14:08:00 |
| 合計ジャッジ時間 | 820 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 |
ソースコード
#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;
}
}