結果

問題 No.1238 選抜クラス
ユーザー paruf4paruf4
提出日時 2020-09-25 23:34:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,078 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 445 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 85,164 KB
最終ジャッジ日時 2023-09-10 17:08:54
合計ジャッジ時間 12,657 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,416 KB
testcase_01 AC 75 ms
71,372 KB
testcase_02 AC 86 ms
76,180 KB
testcase_03 AC 75 ms
71,208 KB
testcase_04 AC 75 ms
71,368 KB
testcase_05 AC 75 ms
71,264 KB
testcase_06 AC 74 ms
71,316 KB
testcase_07 AC 83 ms
76,284 KB
testcase_08 AC 84 ms
76,088 KB
testcase_09 AC 86 ms
76,376 KB
testcase_10 AC 83 ms
76,168 KB
testcase_11 AC 84 ms
76,036 KB
testcase_12 AC 84 ms
76,324 KB
testcase_13 AC 83 ms
76,228 KB
testcase_14 AC 83 ms
76,296 KB
testcase_15 AC 85 ms
76,000 KB
testcase_16 AC 84 ms
76,352 KB
testcase_17 AC 587 ms
76,752 KB
testcase_18 AC 551 ms
76,488 KB
testcase_19 AC 537 ms
76,776 KB
testcase_20 AC 499 ms
76,532 KB
testcase_21 AC 492 ms
76,492 KB
testcase_22 AC 80 ms
76,636 KB
testcase_23 AC 82 ms
76,216 KB
testcase_24 AC 1,078 ms
85,164 KB
testcase_25 AC 1,068 ms
84,740 KB
testcase_26 AC 602 ms
76,612 KB
testcase_27 AC 600 ms
76,652 KB
testcase_28 AC 565 ms
76,512 KB
testcase_29 AC 564 ms
76,484 KB
testcase_30 AC 101 ms
76,480 KB
testcase_31 AC 179 ms
76,768 KB
testcase_32 AC 325 ms
76,564 KB
testcase_33 AC 83 ms
76,056 KB
testcase_34 AC 412 ms
76,608 KB
testcase_35 AC 112 ms
76,752 KB
testcase_36 AC 93 ms
76,344 KB
testcase_37 AC 103 ms
76,520 KB
testcase_38 AC 527 ms
76,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7


sum_a = sum(a)
dp = [[0] * (sum_a + 1) for i in range(n + 1)]
dp[0][0] = 1


for aa in a:
    for i in range(n)[::-1]:
        for j in range(sum_a + 1)[::-1]:
            if j - aa < 0:
                break
            dp[i + 1][j] += dp[i][j - aa]
            dp[i + 1][j] %= mod

ans = 0
for i in range(1, n + 1):
    ans += sum(dp[i][k * i:])
    ans %= mod
print(ans)
0