結果
| 問題 |
No.41 貯金箱の溜息(EASY)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-10 00:24:30 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 19 ms / 5,000 ms |
| コード長 | 619 bytes |
| コンパイル時間 | 1,735 ms |
| コンパイル使用メモリ | 167,244 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-22 00:38:21 |
| 合計ジャッジ時間 | 2,075 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1000000009;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int t;
cin >> t;
int dp[100000] = {};
dp[0] = 1;
for (int i = 1; i <= 9; i++) {
for (int j = 0; j < 100000; j++) {
if (i + j >= 100000) continue;
(dp[i + j] += dp[j]) %= MOD;
}
}
for (int i = 1; i < 100000; i++) (dp[i] += dp[i - 1]) %= MOD;
for (int testcase = 0; testcase < t; testcase++) {
ll m;
cin >> m;
cout << dp[m / 111111] << endl;
}
return 0;
}