結果

問題 No.269 見栄っ張りの募金活動
ユーザー pekempeypekempey
提出日時 2015-08-21 23:20:51
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 693 bytes
コンパイル時間 1,206 ms
コンパイル使用メモリ 144,100 KB
実行使用メモリ 11,656 KB
最終ジャッジ日時 2023-09-25 15:27:08
合計ジャッジ時間 2,421 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 3 ms
7,728 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 3 ms
9,576 KB
testcase_07 WA -
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 4 ms
7,196 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 5 ms
9,452 KB
testcase_19 AC 3 ms
6,704 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 WA -
testcase_22 AC 3 ms
4,664 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, a) rep2 (i, 0, a)
#define rep2(i, a, b) for (int i = (a); i < (b); i++)
#define repr(i, a) repr2 (i, 0, a)
#define repr2(i, a, b) for (int i = (b) - 1; i >= (a); i--)
#define asn(a, b, c) fill_n(&(b), sizeof(a) / sizeof(b), c)
using namespace std;
typedef long long ll;
const ll inf = 1e9;
const ll mod = 1e9 + 7;

ll N, S, K;
ll dp[111][10101];

int main() {
	cin >> N >> S >> K;
	ll T = S - K * N * (N - 1) / 2;

	dp[0][0] = 1;
	rep2 (i, 1, N + 1) {
		rep (j, T + 1) {
			if (j - i >= 0) {
				dp[i][j] = (dp[i - 1][j] + dp[i][j - i]) % mod;
			} else {
				dp[i][j] = dp[i - 1][j];
			}
		}
	}

	ll ans = dp[N][T];
	cout << ans << endl;

	return 0;
}
0