結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー masamasa
提出日時 2015-02-05 04:08:27
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 594 bytes
コンパイル時間 454 ms
コンパイル使用メモリ 65,052 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 12:44:29
合計ジャッジ時間 973 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
4,380 KB
testcase_01 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

const long M_MAX = 1e10;
const int UNIT = 111111;
const int MOD = 1e9 + 9;

int main() {
	int limit = M_MAX / UNIT;
	vector<long long> dp(limit + 1, 1);
	for (int coin = 1; coin <= 9; coin++) {
		for (int i = coin; i <= limit; i++) {
			dp[i] = (dp[i - coin] + dp[i]) % MOD;
		}
	}

	int t, m;

	cin >> m;
	vector<int> ans(m, 0);
	for (int i = 0; i < m; i++) {
		cin >> t;
		ans[i] = dp[t / UNIT];
	}

	for (int i = 0; i < m; i++) {
		cout << ans[i] << endl;
	}
	return 0;
}
0