結果

問題 No.269 見栄っ張りの募金活動
ユーザー vjudge1
提出日時 2025-10-05 16:10:27
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 292 bytes
コンパイル時間 1,322 ms
コンパイル使用メモリ 162,596 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-05 16:10:42
合計ジャッジ時間 2,755 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 16 WA * 2 RE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int dp[20004];
int main(){
	int n,s,k;
	cin>>n>>s>>k;
	long long mod=1000000007;
	s=s-k*n*(n-1)/2;
	if(s<=0){
		cout<<0<<endl;
	}
	dp[0]=1;
	for(int i=n;i>=1;i--){
		for(int j=i;j<=s;j++){
			dp[j]=(dp[j-i]+dp[j])%mod;
		}
	}
	cout<<dp[s]<<endl;
}
0