結果

問題 No.1238 選抜クラス
ユーザー irumo8202irumo8202
提出日時 2022-01-28 13:04:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 305 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 78,856 KB
最終ジャッジ日時 2023-08-28 09:58:09
合計ジャッジ時間 6,396 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,528 KB
testcase_01 AC 88 ms
71,476 KB
testcase_02 AC 90 ms
71,388 KB
testcase_03 AC 93 ms
71,636 KB
testcase_04 AC 89 ms
71,268 KB
testcase_05 AC 90 ms
71,360 KB
testcase_06 AC 89 ms
71,412 KB
testcase_07 AC 91 ms
71,348 KB
testcase_08 AC 90 ms
71,440 KB
testcase_09 AC 107 ms
77,100 KB
testcase_10 AC 89 ms
71,684 KB
testcase_11 AC 94 ms
77,248 KB
testcase_12 AC 90 ms
71,444 KB
testcase_13 AC 88 ms
71,684 KB
testcase_14 AC 87 ms
71,372 KB
testcase_15 AC 94 ms
77,268 KB
testcase_16 AC 95 ms
77,056 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 131 ms
78,796 KB
testcase_20 WA -
testcase_21 AC 127 ms
78,264 KB
testcase_22 WA -
testcase_23 AC 101 ms
77,384 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 129 ms
78,440 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 98 ms
77,280 KB
testcase_31 WA -
testcase_32 AC 116 ms
77,980 KB
testcase_33 AC 89 ms
71,608 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 99 ms
77,104 KB
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

N, K = map(int, input().split())
A = list(map(lambda x: int(x) - K, input().split()))

dp = defaultdict(int)
dp[0] = 1

for a in A:
    for key, cnt in dp.copy().items():
        dp[key + a] += cnt

ans = sum(cnt for key, cnt in dp.items() if key >= 0)
print(ans - 1)
0