結果
| 問題 |
No.41 貯金箱の溜息(EASY)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-10 00:17:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 703 bytes |
| コンパイル時間 | 2,923 ms |
| コンパイル使用メモリ | 168,328 KB |
| 実行使用メモリ | 10,672 KB |
| 最終ジャッジ日時 | 2024-11-22 00:38:08 |
| 合計ジャッジ時間 | 7,936 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 tmp;
cin >> tmp;
tmp /= 111111;
int m = (int)tmp;
vector<int> 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;
}
}
int ans = 0;
for (int i = 0; i <= m; i++) (ans += dp[i]) %= MOD;
cout << ans << endl;
}
return 0;
}