結果

問題 No.269 見栄っ張りの募金活動
ユーザー CleyLCleyL
提出日時 2020-03-16 18:04:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,553 ms / 5,000 ms
コード長 367 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 64,000 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-05-06 01:06:38
合計ジャッジ時間 5,903 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 6 ms
5,376 KB
testcase_04 AC 1,106 ms
6,272 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1,553 ms
11,264 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 458 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 205 ms
5,376 KB
testcase_14 AC 142 ms
5,376 KB
testcase_15 AC 295 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 309 ms
6,400 KB
testcase_19 AC 99 ms
5,376 KB
testcase_20 AC 66 ms
5,376 KB
testcase_21 AC 228 ms
5,376 KB
testcase_22 AC 71 ms
5,376 KB
testcase_23 AC 3 ms
5,376 KB
testcase_24 AC 181 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
const int mod = 1000000007;
int dp[101][20001];
main(){
	int n,s,k;cin>>n>>s>>k;
	s-=((n+(n-1))/2)*((n+(n-1))/2+1)/2*k;
	dp[0][0] = 1;
	if(0>s)cout <<0<< endl;
	else{for(int i=0;n>i;i++)for(int j=0;s>=j;j++)if(dp[i][j])for(int l=0;s>=j+l*(n-i);l++)dp[i+1][j+l*(n-i)]=(dp[i+1][j+l*(n-i)]+dp[i][j])%mod;cout <<dp[n][s]<< endl;}
}
0