結果

問題 No.269 見栄っ張りの募金活動
ユーザー hogeover30hogeover30
提出日時 2016-04-10 23:37:18
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 354 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 58,844 KB
実行使用メモリ 19,500 KB
最終ジャッジ日時 2023-09-23 01:18:32
合計ジャッジ時間 1,595 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 3 ms
4,676 KB
testcase_04 AC 9 ms
9,664 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 20 ms
19,500 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 10 ms
10,652 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 4 ms
5,076 KB
testcase_12 AC 8 ms
9,172 KB
testcase_13 AC 4 ms
5,436 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 4 ms
5,256 KB
testcase_16 AC 8 ms
8,884 KB
testcase_17 AC 3 ms
4,468 KB
testcase_18 AC 14 ms
13,508 KB
testcase_19 AC 5 ms
5,996 KB
testcase_20 AC 3 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 3 ms
4,512 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;

const int mod=1e9+7;
long dp[101][22010];

int main()
{
    int n, s, k;
    cin>>n>>s>>k;

    for(int j=s; j>=0; j-=n) dp[0][j]=1;
    for(int i=1; i<=n; ++i) {
        for(int j=s; j>=0; --j)
            dp[i][j]=(dp[i][j+(n-i)]+dp[i-1][j+k*(n-i)])%mod;
    }
    cout<<dp[n][0]<<endl;
}
0