結果

問題 No.269 見栄っ張りの募金活動
ユーザー matsukin1111matsukin1111
提出日時 2019-06-07 13:25:59
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2,020 ms / 5,000 ms
コード長 1,203 bytes
コンパイル時間 1,014 ms
コンパイル使用メモリ 95,228 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-04-15 08:25:41
合計ジャッジ時間 11,494 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 5 ms
6,940 KB
testcase_03 AC 32 ms
6,940 KB
testcase_04 AC 1,638 ms
6,944 KB
testcase_05 AC 3 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2,020 ms
11,392 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 377 ms
7,168 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 1,016 ms
6,940 KB
testcase_12 AC 279 ms
6,940 KB
testcase_13 AC 317 ms
6,944 KB
testcase_14 AC 363 ms
6,940 KB
testcase_15 AC 456 ms
6,940 KB
testcase_16 AC 430 ms
6,944 KB
testcase_17 AC 28 ms
6,940 KB
testcase_18 AC 1,373 ms
8,576 KB
testcase_19 AC 320 ms
6,940 KB
testcase_20 AC 115 ms
6,944 KB
testcase_21 AC 383 ms
6,940 KB
testcase_22 AC 107 ms
6,940 KB
testcase_23 AC 9 ms
6,940 KB
testcase_24 AC 258 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
using R = double;
using Data = pair < ll, vector <ll>>;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 60;
struct edge { ll from; ll to; ll cost; };
typedef tuple<ll, ll, ll>T;
typedef pair<ll, ll>pll;
#define all(x) (x).begin(),(x).end()
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)
#define INF INT_MAX/2

int N, S, K;
int dp[110][20202];
int main(){
	cin >> N >> S >> K;
	dp[0][0] = 1;
	rep(i, 0, N - 1)rep(j,0,S+1){
		for (int l = K; j+l*(i + 1) <= S; l++) {
			dp[i+1][j+(i+1)*l] += dp[i][j];
			dp[i+1][j+(i+1)*l] %= MOD;
		}
	}
	ll ans = 0;
	for (int a1 = 0; N*a1 <= S; a1++) {
		ans += dp[N-1][S-N*a1];
		ans %= MOD;
	}
	cout << ans % MOD << endl;

	return 0;
}

0