結果
問題 |
No.269 見栄っ張りの募金活動
|
ユーザー |
|
提出日時 | 2016-10-27 11:02:06 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 705 bytes |
コンパイル時間 | 454 ms |
コンパイル使用メモリ | 54,748 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-24 04:02:47 |
合計ジャッジ時間 | 5,412 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 22 |
ソースコード
#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; } std::cout << maney << std::endl; 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; }