結果

問題 No.1238 選抜クラス
ユーザー YamaKasaYamaKasa
提出日時 2020-09-26 14:59:43
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 653 bytes
コンパイル時間 1,672 ms
コンパイル使用メモリ 165,756 KB
実行使用メモリ 19,468 KB
最終ジャッジ日時 2023-09-11 11:48:19
合計ジャッジ時間 3,543 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 3 ms
4,908 KB
testcase_03 AC 2 ms
4,384 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 3 ms
4,512 KB
testcase_08 AC 3 ms
5,044 KB
testcase_09 AC 4 ms
5,672 KB
testcase_10 AC 3 ms
4,604 KB
testcase_11 AC 5 ms
5,868 KB
testcase_12 AC 3 ms
5,076 KB
testcase_13 AC 3 ms
5,060 KB
testcase_14 AC 3 ms
4,908 KB
testcase_15 AC 4 ms
5,672 KB
testcase_16 AC 4 ms
5,544 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 15 ms
18,828 KB
testcase_20 WA -
testcase_21 AC 13 ms
18,200 KB
testcase_22 AC 14 ms
19,140 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 14 ms
19,132 KB
testcase_26 WA -
testcase_27 AC 14 ms
19,124 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 6 ms
8,240 KB
testcase_31 WA -
testcase_32 AC 12 ms
15,532 KB
testcase_33 AC 3 ms
4,452 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 5 ms
6,440 KB
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

const ll mod = pow(10, 9) + 7;

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