結果

問題 No.269 見栄っ張りの募金活動
ユーザー konsin_tokagekonsin_tokage
提出日時 2018-05-11 07:39:07
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 480 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 52,460 KB
実行使用メモリ 18,972 KB
最終ジャッジ日時 2023-09-23 01:30:52
合計ジャッジ時間 31,221 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 12 ms
5,540 KB
testcase_03 AC 86 ms
6,764 KB
testcase_04 AC 4,820 ms
9,468 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 TLE -
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1,150 ms
10,488 KB
testcase_10 AC 4 ms
4,380 KB
testcase_11 AC 3,267 ms
4,980 KB
testcase_12 AC 849 ms
10,292 KB
testcase_13 AC 983 ms
6,536 KB
testcase_14 AC 1,714 ms
4,376 KB
testcase_15 AC 1,411 ms
6,724 KB
testcase_16 AC 1,316 ms
9,868 KB
testcase_17 AC 82 ms
6,344 KB
testcase_18 AC 4,070 ms
14,416 KB
testcase_19 AC 989 ms
7,384 KB
testcase_20 AC 391 ms
4,380 KB
testcase_21 AC 1,481 ms
4,376 KB
testcase_22 AC 335 ms
6,032 KB
testcase_23 AC 21 ms
5,644 KB
testcase_24 AC 850 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
#define ll long long
ll dp[101][20001];
int main(){
    int n, s, k;
    cin >> n >> s >> k;
    dp[n][0] = 1;
    for(int i=n-1; i>=0; --i){
        for(int j=0; j<=s; ++j){
            for(int v=0; v<=j; ++v){
                int w=v+(v+k)*(n-1-i);
                if(j<w) break;
                dp[i][j] += dp[i+1][j-w];
                dp[i][j] %= 1000000007;
            }
        }
    }
    cout << dp[0][s] << endl;
    return 0;
}
0