結果

問題 No.1238 選抜クラス
ユーザー YamaKasaYamaKasa
提出日時 2020-09-26 15:07:04
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 721 bytes
コンパイル時間 1,637 ms
コンパイル使用メモリ 164,112 KB
実行使用メモリ 19,152 KB
最終ジャッジ日時 2023-09-11 11:56:29
合計ジャッジ時間 3,597 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 4 ms
4,808 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 4 ms
4,540 KB
testcase_08 AC 4 ms
4,772 KB
testcase_09 AC 5 ms
5,548 KB
testcase_10 AC 4 ms
4,508 KB
testcase_11 AC 5 ms
5,384 KB
testcase_12 AC 4 ms
4,896 KB
testcase_13 AC 4 ms
4,888 KB
testcase_14 AC 4 ms
5,060 KB
testcase_15 AC 5 ms
5,600 KB
testcase_16 AC 5 ms
5,436 KB
testcase_17 AC 25 ms
18,956 KB
testcase_18 AC 24 ms
18,584 KB
testcase_19 AC 25 ms
18,660 KB
testcase_20 AC 24 ms
18,276 KB
testcase_21 AC 23 ms
17,904 KB
testcase_22 AC 27 ms
18,952 KB
testcase_23 WA -
testcase_24 AC 25 ms
18,952 KB
testcase_25 AC 27 ms
19,000 KB
testcase_26 AC 25 ms
18,976 KB
testcase_27 AC 25 ms
18,964 KB
testcase_28 AC 25 ms
19,028 KB
testcase_29 AC 25 ms
18,680 KB
testcase_30 AC 9 ms
8,248 KB
testcase_31 AC 15 ms
12,008 KB
testcase_32 AC 19 ms
15,440 KB
testcase_33 AC 3 ms
4,420 KB
testcase_34 AC 21 ms
16,692 KB
testcase_35 AC 11 ms
9,308 KB
testcase_36 AC 6 ms
6,184 KB
testcase_37 AC 9 ms
8,372 KB
testcase_38 AC 24 ms
18,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

const ll mod = pow(10, 9) + 7;
const int l = 2 * 100 * 100 + 1;
const int m = 100 * 100;
ll dp[101][l]{};

int main() {
    int N, K;
    cin >> N >> K;
    ll A[N];
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        A[i] -= K;
    }
    dp[0][m] = 1;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j + A[i] < l; j++) {
            dp[i + 1][j] += dp[i][j];
            dp[i + 1][j] %= mod;
            dp[i + 1][j + A[i]] += dp[i][j];
            dp[i + 1][j + A[i]] %= mod;
        }
    }
    ll s = 0;
    for (int i = m; i < l; i++) {
        s += dp[N][i];
        s %= mod;
    }
    cout << s - 1<< "\n";
    return 0;
}
0