結果

問題 No.269 見栄っ張りの募金活動
ユーザー GGanariGGanari
提出日時 2024-03-22 13:16:57
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 877 bytes
コンパイル時間 3,092 ms
コンパイル使用メモリ 222,388 KB
実行使用メモリ 19,052 KB
最終ジャッジ日時 2024-03-22 13:17:02
合計ジャッジ時間 4,535 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2")
#include <bits/stdc++.h>
#define INF 1000000001LL
#define LNF 1000000000000000001LL
#define MOD 1000000007LL
#define MAX 502
#define long long long
#define all(x) x.begin(),x.end()
using namespace std;

int main()
{
	ios_base::sync_with_stdio(0); 
    cin.tie(0);

    int n,s,k;
    cin >> n >> s >> k;
    long dp[n][s+1];

    memset(dp,0,sizeof dp);

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

    return 0;
}
0