結果
| 問題 | No.41 貯金箱の溜息(EASY) |
| コンテスト | |
| ユーザー |
ふーらくたる
|
| 提出日時 | 2016-08-05 19:16:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 733 bytes |
| 記録 | |
| コンパイル時間 | 538 ms |
| コンパイル使用メモリ | 60,316 KB |
| 実行使用メモリ | 11,180 KB |
| 最終ジャッジ日時 | 2024-11-07 00:15:52 |
| 合計ジャッジ時間 | 7,012 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 TLE * 1 |
ソースコード
#include <iostream>
#include <vector>
#include <numeric>
using namespace std;
typedef long long ll;
ll MOD = 1000 * 1000 * 1000 + 9;
const auto PRICE1 = 111111;
int main() {
int T;
cin >> T;
while (T--) {
ll M;
cin >> M;
vector<ll> dp(M / PRICE1 + 1, 0);
dp[0] = 1;
for (auto price = 1; price <= 9; price++) {
for (auto use = 0; use < dp.size(); use++) {
if (use - price < 0) continue;
dp[use] += dp[use - price];
dp[use] %= MOD;
}
}
ll ans = 0;
for (auto ways : dp) {
ans += ways;
ans %= MOD;
}
cout << ans << endl;
}
return 0;
}
ふーらくたる