結果

問題 No.269 見栄っ張りの募金活動
ユーザー hogeover30hogeover30
提出日時 2016-04-10 23:30:13
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 21 ms / 5,000 ms
コード長 359 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 59,120 KB
実行使用メモリ 19,532 KB
最終ジャッジ日時 2023-09-23 01:18:25
合計ジャッジ時間 1,466 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 3 ms
4,760 KB
testcase_04 AC 9 ms
9,592 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 21 ms
19,532 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 10 ms
10,692 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 3 ms
5,220 KB
testcase_12 AC 9 ms
9,072 KB
testcase_13 AC 4 ms
5,484 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 3 ms
5,292 KB
testcase_16 AC 7 ms
8,676 KB
testcase_17 AC 3 ms
4,608 KB
testcase_18 AC 14 ms
13,476 KB
testcase_19 AC 4 ms
6,012 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 3 ms
4,524 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,376 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=0; i<n; ++i) {
        for(int j=s; j>=0; --j)
            dp[i+1][j]=(dp[i+1][j+(n-i-1)]+dp[i][j+k*(n-i-1)])%mod;
    }
    cout<<dp[n][0]<<endl;
}
0