結果

問題 No.1238 選抜クラス
ユーザー ぷらぷら
提出日時 2020-09-25 21:45:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 785 bytes
コンパイル時間 1,443 ms
コンパイル使用メモリ 165,344 KB
実行使用メモリ 561,208 KB
最終ジャッジ日時 2023-09-10 15:08:29
合計ジャッジ時間 6,423 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,492 KB
testcase_01 AC 4 ms
9,472 KB
testcase_02 AC 7 ms
21,728 KB
testcase_03 AC 2 ms
5,408 KB
testcase_04 AC 2 ms
5,344 KB
testcase_05 AC 2 ms
5,384 KB
testcase_06 AC 2 ms
5,336 KB
testcase_07 AC 6 ms
15,756 KB
testcase_08 AC 7 ms
21,760 KB
testcase_09 AC 10 ms
32,140 KB
testcase_10 AC 6 ms
17,684 KB
testcase_11 AC 10 ms
29,924 KB
testcase_12 AC 8 ms
23,880 KB
testcase_13 AC 8 ms
23,808 KB
testcase_14 AC 7 ms
21,760 KB
testcase_15 AC 11 ms
31,972 KB
testcase_16 AC 10 ms
29,972 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 371 ms
493,876 KB
testcase_20 MLE -
testcase_21 AC 166 ms
498,940 KB
testcase_22 MLE -
testcase_23 MLE -
testcase_24 MLE -
testcase_25 MLE -
testcase_26 MLE -
testcase_27 MLE -
testcase_28 MLE -
testcase_29 MLE -
testcase_30 AC 28 ms
83,164 KB
testcase_31 AC 72 ms
212,232 KB
testcase_32 AC 122 ms
374,076 KB
testcase_33 AC 6 ms
15,608 KB
testcase_34 WA -
testcase_35 AC 39 ms
115,968 KB
testcase_36 AC 14 ms
40,292 KB
testcase_37 AC 31 ms
91,460 KB
testcase_38 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 5e18+7;
int mod = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
long double pi = 3.141592653589793238;
int dp[105][105][10005];
signed main() {
    int N,K;
    cin >> N >> K;
    dp[0][0][0] = 1;
    for(int i = 0; i < N; i++) {
        int A;
        cin >> A;
        for(int j = 0; j <= i; j++) {
            for(int k = 0; k <= 10000; k++) {
                dp[i+1][j][k] += dp[i][j][k];
                dp[i+1][j+1][k+A] += dp[i][j][k];
            }
        }
    }
    int ans = 0;
    for(int i = 1; i <= N; i++) {
        for(int j = K*i; j <= 10000; j++) {
            ans += dp[N][i][j];
            ans %= mod;
        }
    }
    cout << ans << endl;
}
0