結果

問題 No.269 見栄っ張りの募金活動
ユーザー hogeover30hogeover30
提出日時 2016-04-10 23:22:54
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 58,112 KB
実行使用メモリ 10,144 KB
最終ジャッジ日時 2024-04-14 23:56:17
合計ジャッジ時間 7,046 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 3 ms
6,940 KB
testcase_04 WA -
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

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*k) 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