結果

問題 No.1238 選抜クラス
ユーザー 👑 timitimi
提出日時 2020-09-27 22:35:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,205 ms / 2,000 ms
コード長 434 bytes
コンパイル時間 662 ms
コンパイル使用メモリ 10,852 KB
実行使用メモリ 33,308 KB
最終ジャッジ日時 2023-09-13 03:42:34
合計ジャッジ時間 23,793 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
8,660 KB
testcase_01 AC 51 ms
8,852 KB
testcase_02 AC 112 ms
9,784 KB
testcase_03 AC 15 ms
8,164 KB
testcase_04 AC 15 ms
8,036 KB
testcase_05 AC 15 ms
8,080 KB
testcase_06 AC 15 ms
8,172 KB
testcase_07 AC 85 ms
9,312 KB
testcase_08 AC 119 ms
9,944 KB
testcase_09 AC 179 ms
10,604 KB
testcase_10 AC 94 ms
9,468 KB
testcase_11 AC 167 ms
10,440 KB
testcase_12 AC 126 ms
10,056 KB
testcase_13 AC 129 ms
9,980 KB
testcase_14 AC 118 ms
9,872 KB
testcase_15 AC 175 ms
10,672 KB
testcase_16 AC 165 ms
10,520 KB
testcase_17 AC 1,167 ms
29,512 KB
testcase_18 AC 1,141 ms
27,340 KB
testcase_19 AC 1,123 ms
31,468 KB
testcase_20 AC 1,100 ms
29,252 KB
testcase_21 AC 1,067 ms
28,540 KB
testcase_22 AC 1,140 ms
24,304 KB
testcase_23 AC 1,128 ms
24,324 KB
testcase_24 AC 1,140 ms
24,368 KB
testcase_25 AC 1,148 ms
24,444 KB
testcase_26 AC 1,147 ms
29,384 KB
testcase_27 AC 1,205 ms
33,308 KB
testcase_28 AC 1,143 ms
28,860 KB
testcase_29 AC 1,143 ms
27,936 KB
testcase_30 AC 351 ms
13,336 KB
testcase_31 AC 650 ms
18,356 KB
testcase_32 AC 893 ms
24,420 KB
testcase_33 AC 82 ms
9,400 KB
testcase_34 AC 968 ms
24,672 KB
testcase_35 AC 439 ms
14,748 KB
testcase_36 AC 224 ms
11,316 KB
testcase_37 AC 371 ms
13,684 KB
testcase_38 AC 1,087 ms
27,548 KB
権限があれば一括ダウンロードができます

ソースコード

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(20200)]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]
        dp[i+1][j]%=10**9+7
ans=sum(dp[N][10000:])-1
ans%=10**9+7
print(ans)
0