結果
| 問題 | 
                            No.269 見栄っ張りの募金活動
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-11-05 17:20:47 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,181 bytes | 
| コンパイル時間 | 1,638 ms | 
| コンパイル使用メモリ | 172,380 KB | 
| 実行使用メモリ | 19,584 KB | 
| 最終ジャッジ日時 | 2024-07-19 09:40:29 | 
| 合計ジャッジ時間 | 2,603 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 15 WA * 7 | 
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,a,n) for(int i=(int)a;i<(int)n;++i)
#define fi first
#define se second
#define PI 3.14159265359
using namespace std;
using ll=long long;
using pii=pair<int,int>;
using pll=pair<long long,long long>;
using veci=vector<int>;
using vecii=vector<pair<int,int>>;
using vecll=vector<long long>;
using vecpll=vector<pair<long long,long long>>;
using vecs=vector<string>;
using vecb=vector<bool>;
using vecd=vector<double>;
template<class T> inline bool chmax(T& a,T b){if(a<b) {a=b;return true;} return false;}
template<class T> inline bool chmin(T& a,T b){if(a>b) {a=b;return true;} return false;}
 
constexpr int INF=1<<30;
//constexpr ll INF=1LL<<61;
//constexpr int MOD=1000000007;
constexpr ll MOD=1000000007;
//constexpr ll MOD=998244353;
//constexpr int LOG=62;
int main(){
	//ifstream in("input.txt");
  //cin.rdbuf(in.rdbuf());
	
	ll n,s,k;cin>>n>>s>>k;
	s-=n*(n-1)*k/2;
	if(s<=0) {
		cout<<0<<endl;
		return 0;
	}
	vector<vecll> dp(s+1,vecll(n+1,0));
	rep(i,n) dp[0][i]=1;
	rep1(i,1,s+1) rep1(j,1,n+1){
		dp[i][j]=dp[i][j-1]+(i>=j?dp[i-j][j]:0);
		dp[i][j]%=MOD;
	}
	cout<<dp[s][n]<<endl;
}