結果

問題 No.269 見栄っ張りの募金活動
ユーザー KenDoiKenDoi
提出日時 2023-04-01 02:45:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 61 ms / 5,000 ms
コード長 1,110 bytes
コンパイル時間 804 ms
コンパイル使用メモリ 97,516 KB
実行使用メモリ 19,208 KB
最終ジャッジ日時 2023-10-24 12:01:41
合計ジャッジ時間 2,253 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 6 ms
4,892 KB
testcase_04 AC 24 ms
9,516 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 61 ms
19,208 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 28 ms
10,844 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 8 ms
5,136 KB
testcase_12 AC 23 ms
9,276 KB
testcase_13 AC 9 ms
5,596 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 8 ms
5,404 KB
testcase_16 AC 20 ms
8,732 KB
testcase_17 AC 6 ms
4,688 KB
testcase_18 AC 39 ms
13,528 KB
testcase_19 AC 11 ms
6,160 KB
testcase_20 AC 3 ms
4,348 KB
testcase_21 AC 4 ms
4,348 KB
testcase_22 AC 6 ms
4,748 KB
testcase_23 AC 3 ms
4,348 KB
testcase_24 AC 4 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <stack>
#include <queue>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <cmath>
#include<sstream>
#include<list>
#include<iomanip>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <bitset>
#include <cassert>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
const int INF = 100000000;
const long long LINF = 3e18 + 7;
const int MAX_N = 6000010;
const int MAX_W = 10002;
const int MAX_ARRAYK = 100000;
double PI = 3.14159265358979323846;
//using ll = long long;


int N;
int S, K;
long long dp[110][20010];
long long mod = 1000000007;

int main() {

	cin >> N >> S >> K;

	for (int i = 0; i <= S; i += N) {
		dp[0][i] = 1;
	}

	for (int i = 1; i < N; i++) {
		for (int j = 0; j <= S; j++) {

			if (j - K * (N - i) >= 0) {
				dp[i][j] += dp[i - 1][j - K * (N - i)];
			}

			dp[i][j] %= mod;

			if (j - (N - i) >= 0) {
				dp[i][j] += dp[i][j - (N - i)];
			}
			dp[i][j] %= mod;
		}
	}
	
	cout << dp[N - 1][S] << endl;

	return 0;
}
0