結果
| 問題 |
No.1238 選抜クラス
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-26 20:03:06 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 246 ms / 2,000 ms |
| コード長 | 442 bytes |
| コンパイル時間 | 138 ms |
| コンパイル使用メモリ | 82,440 KB |
| 実行使用メモリ | 84,100 KB |
| 最終ジャッジ日時 | 2024-06-29 17:39:19 |
| 合計ジャッジ時間 | 5,794 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 |
ソースコード
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])