結果

問題 No.269 見栄っ張りの募金活動
ユーザー 🍡yurahuna🍡yurahuna
提出日時 2016-02-27 11:52:51
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 927 bytes
コンパイル時間 604 ms
コンパイル使用メモリ 74,352 KB
実行使用メモリ 19,276 KB
最終ジャッジ日時 2023-10-24 18:26:20
合計ジャッジ時間 1,505 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 3 ms
4,948 KB
testcase_04 AC 4 ms
10,460 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 WA -
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 10 ms
13,004 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 3 ms
6,364 KB
testcase_12 AC 7 ms
10,388 KB
testcase_13 AC 3 ms
8,092 KB
testcase_14 WA -
testcase_15 AC 3 ms
8,172 KB
testcase_16 AC 6 ms
10,684 KB
testcase_17 AC 2 ms
4,688 KB
testcase_18 AC 5 ms
16,524 KB
testcase_19 AC 3 ms
8,320 KB
testcase_20 AC 2 ms
5,988 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 3 ms
4,820 KB
testcase_23 AC 1 ms
4,348 KB
testcase_24 AC 2 ms
6,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <complex>
#include <queue>
#include <map>
#include <string>
using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

#define PI 3.1415926535

typedef long long ll;
typedef pair<int, int> P;
//typedef complex<double> C;

const int MAX_N = 100;
const int MAX_S = 20000;

const ll mod = 1000000007;

int N, S, K;
ll dp[MAX_N][MAX_S + 1];

void input() {
	cin >> N >> S >> K;
}

void solve() {
	int s = 0;
	while (s <= S) {
		dp[0][s] = 1;
		s += N;
	}
	FOR(i, 1, N) {
		FOR(j, K * (N - i), S + 1) {
			dp[i][j] = dp[i - 1][j - K * (N - i)] + dp[i][j - (N - i)];
			dp[i][j] %= mod;
		}
	}
	cout << dp[N - 1][S] << endl;
}

int main() {
	input();
	solve();
}
0