結果

問題 No.1238 選抜クラス
ユーザー ぷらぷら
提出日時 2020-09-25 21:50:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 842 bytes
コンパイル時間 1,577 ms
コンパイル使用メモリ 163,708 KB
実行使用メモリ 570,280 KB
最終ジャッジ日時 2023-09-10 15:15:41
合計ジャッジ時間 7,545 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,556 KB
testcase_01 AC 3 ms
9,556 KB
testcase_02 AC 8 ms
23,820 KB
testcase_03 AC 2 ms
5,448 KB
testcase_04 AC 2 ms
5,492 KB
testcase_05 AC 2 ms
5,448 KB
testcase_06 AC 3 ms
5,388 KB
testcase_07 AC 6 ms
15,732 KB
testcase_08 AC 8 ms
23,868 KB
testcase_09 AC 13 ms
38,192 KB
testcase_10 AC 6 ms
17,748 KB
testcase_11 AC 11 ms
34,160 KB
testcase_12 AC 8 ms
25,880 KB
testcase_13 AC 9 ms
25,924 KB
testcase_14 AC 7 ms
23,820 KB
testcase_15 AC 12 ms
38,232 KB
testcase_16 AC 11 ms
34,104 KB
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 WA -
testcase_21 AC 234 ms
482,684 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 32 ms
97,652 KB
testcase_31 AC 79 ms
230,668 KB
testcase_32 AC 133 ms
388,428 KB
testcase_33 AC 5 ms
15,880 KB
testcase_34 WA -
testcase_35 AC 44 ms
134,432 KB
testcase_36 AC 17 ms
50,444 KB
testcase_37 AC 35 ms
106,024 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[110][110][10010];
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];
                if(k+A <= 10000) {
                    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