結果
| 問題 |
No.41 貯金箱の溜息(EASY)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-10 00:15:03 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 669 bytes |
| コンパイル時間 | 1,569 ms |
| コンパイル使用メモリ | 169,040 KB |
| 実行使用メモリ | 11,200 KB |
| 最終ジャッジ日時 | 2024-11-22 00:37:55 |
| 合計ジャッジ時間 | 8,313 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 TLE * 1 |
ソースコード
#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;
for (int testcase = 0; testcase < t; testcase++) {
ll m;
cin >> m;
m /= 111111;
vector<ll> dp(m + 1, 0);
dp[0] = 1;
for (int i = 1; i <= 9; i++) {
for (int j = 0; j <= m; j++) {
if (i + j > m) continue;
(dp[i + j] += dp[j]) %= MOD;
}
}
ll ans = 0;
for (int i = 0; i <= m; i++) (ans += dp[i]) %= MOD;
cout << ans << endl;
}
return 0;
}