結果

問題 No.1238 選抜クラス
ユーザー ks2mks2m
提出日時 2020-09-25 21:53:55
言語 Java21
(openjdk 21)
結果
MLE  
実行時間 -
コード長 1,088 bytes
コンパイル時間 2,570 ms
コンパイル使用メモリ 75,964 KB
実行使用メモリ 742,244 KB
最終ジャッジ日時 2023-09-10 15:22:42
合計ジャッジ時間 18,648 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,464 KB
testcase_01 AC 45 ms
49,320 KB
testcase_02 AC 56 ms
59,376 KB
testcase_03 AC 44 ms
49,432 KB
testcase_04 AC 44 ms
49,196 KB
testcase_05 AC 43 ms
47,884 KB
testcase_06 AC 43 ms
49,784 KB
testcase_07 AC 50 ms
54,628 KB
testcase_08 AC 55 ms
59,248 KB
testcase_09 AC 86 ms
68,448 KB
testcase_10 AC 51 ms
55,120 KB
testcase_11 AC 64 ms
63,060 KB
testcase_12 AC 57 ms
59,320 KB
testcase_13 AC 57 ms
59,132 KB
testcase_14 AC 54 ms
59,536 KB
testcase_15 AC 84 ms
68,076 KB
testcase_16 AC 64 ms
63,556 KB
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
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 167 ms
130,408 KB
testcase_31 AC 356 ms
364,604 KB
testcase_32 MLE -
testcase_33 AC 50 ms
54,632 KB
testcase_34 MLE -
testcase_35 AC 194 ms
191,864 KB
testcase_36 AC 102 ms
84,440 KB
testcase_37 AC 149 ms
137,260 KB
testcase_38 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int n = Integer.parseInt(sa[0]);
		int k = Integer.parseInt(sa[1]);
		sa = br.readLine().split(" ");
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sa[i]);
		}
		br.close();

		int mod = 1000000007;
		long[][][] dp = new long[n + 1][n + 1][10001];
		dp[0][0][0] = 1;
		for (int i = 0; i < n; i++) {
			int i1 = i + 1;
			for (int j = 0; j <= i; j++) {
				for (int j2 = 0; j2 <= 100 * i; j2++) {
					dp[i1][j][j2] += dp[i][j][j2];
					dp[i1][j + 1][j2 + a[i]] += dp[i][j][j2];
				}
			}
			for (int j = 0; j <= i1; j++) {
				for (int j2 = 0; j2 <= 100 * i1; j2++) {
					dp[i1][j][j2] %= mod;
				}
			}
		}

		long ans = 0;
		for (int j = 1; j <= n; j++) {
			for (int j2 = j * k; j2 <= 10000; j2++) {
				ans += dp[n][j][j2];
			}
		}
		ans %= mod;
		System.out.println(ans);
	}
}
0