結果

問題 No.1238 選抜クラス
ユーザー tikitaka1201tikitaka1201
提出日時 2020-09-26 20:03:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 281 ms / 2,000 ms
コード長 442 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 84,924 KB
最終ジャッジ日時 2023-09-12 04:36:20
合計ジャッジ時間 8,418 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
75,132 KB
testcase_01 AC 72 ms
74,956 KB
testcase_02 AC 78 ms
76,136 KB
testcase_03 AC 75 ms
75,144 KB
testcase_04 AC 74 ms
75,180 KB
testcase_05 AC 74 ms
75,136 KB
testcase_06 AC 74 ms
75,060 KB
testcase_07 AC 76 ms
76,176 KB
testcase_08 AC 78 ms
76,128 KB
testcase_09 AC 78 ms
75,912 KB
testcase_10 AC 78 ms
76,180 KB
testcase_11 AC 78 ms
76,236 KB
testcase_12 AC 77 ms
76,180 KB
testcase_13 AC 78 ms
76,072 KB
testcase_14 AC 78 ms
75,872 KB
testcase_15 AC 77 ms
76,072 KB
testcase_16 AC 79 ms
76,224 KB
testcase_17 AC 279 ms
84,924 KB
testcase_18 AC 262 ms
84,656 KB
testcase_19 AC 258 ms
76,348 KB
testcase_20 AC 251 ms
84,308 KB
testcase_21 AC 225 ms
76,440 KB
testcase_22 AC 280 ms
84,868 KB
testcase_23 AC 271 ms
76,348 KB
testcase_24 AC 281 ms
84,532 KB
testcase_25 AC 270 ms
76,564 KB
testcase_26 AC 280 ms
84,892 KB
testcase_27 AC 270 ms
76,532 KB
testcase_28 AC 280 ms
84,888 KB
testcase_29 AC 262 ms
84,544 KB
testcase_30 AC 86 ms
76,648 KB
testcase_31 AC 113 ms
76,568 KB
testcase_32 AC 167 ms
76,436 KB
testcase_33 AC 77 ms
76,052 KB
testcase_34 AC 197 ms
76,548 KB
testcase_35 AC 90 ms
76,376 KB
testcase_36 AC 78 ms
75,872 KB
testcase_37 AC 84 ms
76,552 KB
testcase_38 AC 250 ms
84,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dp=[[0]*(100*100+1) for _ in range(n+1)]
# dp[ここまで選んだ人数][点数]
dp[0][0]=1

for i in range(n):
    for j in range(i+1, 0,-1):
        for score in range((j-1)*100+1):
            dp[j][score+a[i]]+=dp[j-1][score]
            dp[j][score+a[i]]%=mod

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