結果

問題 No.1238 選抜クラス
ユーザー Example0911Example0911
提出日時 2020-09-25 22:50:26
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 978 bytes
コンパイル時間 1,732 ms
コンパイル使用メモリ 170,240 KB
実行使用メモリ 31,844 KB
最終ジャッジ日時 2023-09-10 16:02:11
合計ジャッジ時間 6,322 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
10,240 KB
testcase_01 AC 8 ms
6,008 KB
testcase_02 AC 38 ms
6,832 KB
testcase_03 AC 3 ms
5,700 KB
testcase_04 AC 3 ms
5,616 KB
testcase_05 AC 3 ms
5,628 KB
testcase_06 AC 3 ms
5,744 KB
testcase_07 AC 20 ms
6,300 KB
testcase_08 AC 38 ms
6,880 KB
testcase_09 AC 83 ms
7,656 KB
testcase_10 AC 25 ms
6,572 KB
testcase_11 AC 73 ms
7,488 KB
testcase_12 AC 45 ms
7,188 KB
testcase_13 AC 46 ms
7,076 KB
testcase_14 AC 38 ms
6,732 KB
testcase_15 AC 84 ms
7,644 KB
testcase_16 AC 73 ms
7,612 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"

//#include <atcoder/all>

using namespace std;
//using namespace atcoder;

#define int long long
#define ll long long

ll INF = (1LL << 60);
int mod = 1000000007;
using P = pair<int, int>;
int dp[2][110][10010];
signed main() {
	int N, K; cin >> N >> K;
	vector<int>A(N); for (int i = 0; i < N; i++)cin >> A[i];
	dp[0][0][0] = 1;
	for (int i = 0; i < N; i++) {
		vector<vector<int>>dp2(N + 2, vector<int>(10011));
		for (int j = 0; j <= N; j++) {
			for (int k = 0; k < 10001; k++) {
				int now = 0;
				(now += dp[i%2][j][k]) %= mod;
				now %= mod;
				(dp2[j][k] += now)%=mod;
				if (k + A[i] <= 10010)(dp2[j + 1][k + A[i]] += now) %= mod;
			}
		}
		for (int j = 0; j <= N; j++) {
			for (int k = 0; k < 10001; k++) {
				dp[(i+1)%2][j][k] = dp2[j][k];
			}
		}
	

		
	}
	int ans = 0;
	for (int j = 1; j <= N; j++) {
		for (int k = j * K; k <= 10009; k++) {
			ans += dp[N % 2][j][k];
			
			ans %= mod;
		}
	}
	cout << ans << endl;
	return 0;
}
0