結果

問題 No.1238 選抜クラス
ユーザー 👑 timitimi
提出日時 2020-09-27 22:29:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 385 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 10,952 KB
実行使用メモリ 31,516 KB
最終ジャッジ日時 2023-09-13 03:35:52
合計ジャッジ時間 8,852 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
8,692 KB
testcase_01 AC 41 ms
8,856 KB
testcase_02 AC 92 ms
9,964 KB
testcase_03 AC 15 ms
8,256 KB
testcase_04 AC 15 ms
8,108 KB
testcase_05 AC 15 ms
8,212 KB
testcase_06 AC 15 ms
8,216 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 130 ms
10,632 KB
testcase_10 AC 75 ms
9,488 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 95 ms
10,080 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 WA -
testcase_23 RE -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 AC 164 ms
11,416 KB
testcase_37 RE -
testcase_38 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int, input().split())
A=list(map(int, input().split()))
if N==1:
    if A[0]<K:
        print(0)
        exit()
    else:
        print(1)
        exit()
for i in range(N):
    A[i]-=K 
#print(A)
dp=[[0 for i in range(20010)]for i in range(N+1)]
dp[0][10000]=1
for i in range(N):
    for j in range(20001):
        dp[i+1][j]+=dp[i][j-A[i]]+dp[i][j]
print(sum(dp[N][10000:])-1)
0