結果

問題 No.1238 選抜クラス
ユーザー umezoumezo
提出日時 2020-09-25 23:19:51
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 360 ms / 2,000 ms
コード長 700 bytes
コンパイル時間 2,051 ms
コンパイル使用メモリ 201,640 KB
実行使用メモリ 433,512 KB
最終ジャッジ日時 2023-09-10 16:19:31
合計ジャッジ時間 8,574 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,640 KB
testcase_01 AC 3 ms
9,548 KB
testcase_02 AC 8 ms
23,876 KB
testcase_03 AC 2 ms
5,524 KB
testcase_04 AC 2 ms
5,436 KB
testcase_05 AC 2 ms
5,720 KB
testcase_06 AC 2 ms
5,456 KB
testcase_07 AC 5 ms
15,836 KB
testcase_08 AC 8 ms
24,152 KB
testcase_09 AC 13 ms
36,116 KB
testcase_10 AC 6 ms
17,756 KB
testcase_11 AC 12 ms
34,260 KB
testcase_12 AC 9 ms
27,984 KB
testcase_13 AC 9 ms
27,920 KB
testcase_14 AC 8 ms
23,828 KB
testcase_15 AC 13 ms
36,160 KB
testcase_16 AC 12 ms
34,092 KB
testcase_17 AC 334 ms
421,844 KB
testcase_18 AC 296 ms
406,688 KB
testcase_19 AC 360 ms
411,768 KB
testcase_20 AC 269 ms
412,976 KB
testcase_21 AC 249 ms
398,640 KB
testcase_22 AC 288 ms
433,436 KB
testcase_23 AC 288 ms
433,452 KB
testcase_24 AC 287 ms
433,472 KB
testcase_25 AC 286 ms
433,436 KB
testcase_26 AC 288 ms
433,512 KB
testcase_27 AC 287 ms
433,500 KB
testcase_28 AC 289 ms
433,424 KB
testcase_29 AC 279 ms
425,576 KB
testcase_30 AC 40 ms
97,592 KB
testcase_31 AC 109 ms
228,680 KB
testcase_32 AC 188 ms
335,180 KB
testcase_33 AC 5 ms
15,644 KB
testcase_34 AC 222 ms
369,964 KB
testcase_35 AC 58 ms
136,464 KB
testcase_36 AC 19 ms
50,440 KB
testcase_37 AC 44 ms
105,804 KB
testcase_38 AC 262 ms
412,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

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

const int MOD = 1000000007;

int dp[110][110][10010];

int main(){
  int n,k;
  cin>>n>>k;
  
  vector<int> A(n+1);
  rep(i,n) cin>>A[i+1];
  
  dp[0][0][0]=1;
  for(int i=1;i<=n;i++){
    for(int j=0;j<=n;j++){
      for(int k=0;k<=10000;k++){
        if(k-A[i]<0 || j-1<0) dp[i][j][k]=dp[i-1][j][k];
        else dp[i][j][k]=(dp[i-1][j][k]+dp[i-1][j-1][k-A[i]])%MOD;
      } 
    }
  }
  
  int ans=0;
  for(int i=1;i<=n;i++){
    for(int j=k*i;j<=10000;j++){
      ans=(ans+dp[n][i][j])%MOD;
    }
  }
  cout<<ans<<endl;
  
  
  return 0;
}
0