結果
| 問題 |
No.1238 選抜クラス
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2024-12-04 19:49:54 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 464 bytes |
| コンパイル時間 | 322 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 364,696 KB |
| 最終ジャッジ日時 | 2024-12-04 19:50:34 |
| 合計ジャッジ時間 | 39,621 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 TLE * 12 |
ソースコード
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)
ntuda