結果

問題 No.269 見栄っ張りの募金活動
ユーザー highdhighd
提出日時 2016-10-27 11:03:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 671 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 64,128 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-24 04:02:53
合計ジャッジ時間 5,254 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdint>

int main() {
	std::uint_fast32_t map[20001] = { 1 };
	std::uint_fast32_t map_tmp[20001] = { 1 };
	int n, maney, k;
	std::cin >> n >> maney >> k;
	maney -= (n - 1)*n/2*k;

	for (int i = 0; i <= maney; i++) {
		map[i] = 1;
	}
	for (int i = 1; i < n ; i++) {
		for (int j = 0; j <= maney; j++) {
			int now_maney = j;
			std::uint_fast32_t count = 0;
			while (now_maney >= 0) {
				count += map[now_maney];
				if (count > 1000000007) {
					count -= 1000000007;
				}
				now_maney -= i + 1;
			}
			map_tmp[j] = count;
		}
		for (int j = 0; j <= maney; j++) {
			map[j] = map_tmp[j];
		}
	}
	std::cout << map[maney] << std::endl;
}
0