結果

問題 No.1238 選抜クラス
コンテスト
ユーザー ntuda
提出日時 2024-12-04 19:49:54
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
TLE  
実行時間 -
コード長 464 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 301 ms
コンパイル使用メモリ 85,636 KB
実行使用メモリ 318,320 KB
最終ジャッジ日時 2026-05-24 16:25:24
合計ジャッジ時間 8,707 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 TLE * 1 -- * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

MOD = 10 ** 9 + 7
N, K = map(int, input().split())
A = list(map(int,input().split()))
from collections import defaultdict
dic = defaultdict(int)
dic[(0,0)] = 1
for a in A:
    dic2 = defaultdict(int)
    for (x,y),v in dic.items():
        dic2[(x,y)] += v
        dic2[(x,y)] %= MOD
        dic2[(x+1,y+a)] += v
        dic2[(x+1,y+a)] %= MOD
    dic = dic2
ans = 0
for (x,y),v in dic.items():
    if y >= K * x:
        ans += v
        ans %= MOD
print(ans - 1)
0