結果

問題 No.269 見栄っ張りの募金活動
ユーザー oxyshoweroxyshower
提出日時 2019-07-03 20:15:42
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 672 bytes
コンパイル時間 1,431 ms
コンパイル使用メモリ 164,788 KB
実行使用メモリ 18,920 KB
最終ジャッジ日時 2023-10-14 10:45:39
合計ジャッジ時間 11,844 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long

#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif

signed main(){

  int n,s,k; cin >> n >> s >> k;
  if(s < n*(n-1)*k/2) cout << 0 << endl;
  else{
    static int dp[101][20001]; //生徒iの金額が決まった時クラス合計金額がj円になる場合の数
    dp[0][0] = dp[1][0] = 1;
    for(int i = 0; i < n; i++){
      for(int j = 0; j <= s; j++){
        for(int d = k; d <= s; d++){
          if(j + d*(n-i) > s) break;
          dp[i+1][j + d*(n-i)] += dp[i][j];
          dp[i+1][j + d*(n-i)] %= 1000000007;
        }
      }
    }
    cout << dp[n][s] << endl;
  }

  return 0;
}
0