結果
| 問題 | No.1457 ツブ消ししとるなHard |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-12 10:54:06 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 602 bytes |
| 記録 | |
| コンパイル時間 | 606 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 15,356 KB |
| 最終ジャッジ日時 | 2026-05-18 22:29:04 |
| 合計ジャッジ時間 | 5,296 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | TLE * 1 -- * 16 |
ソースコード
from bisect import *
N,M,X,Y,Z = map(int,input().split())
A = list(map(int,input().split()))
y = bisect_right(A,Y)
x = bisect_left(A,X)
if N-x > M:
print("Handicapped")
exit(0)
s = 2500
dp = [[0]*(s*2+100) for i in range(M+1)]
dp[0][0] = 1
for a in A:
nxt = [[0]*(s*2+100) for i in range(M+1)]
for i in range(M+1):
for j in range(-s,s+1):
if i+1 <= M and Y < a and -s <= j+a-Z <= s:
nxt[i+1][j+a-Z] += dp[i][j]
if a < X:
nxt[i][j] += dp[i][j]
dp = nxt
ans = 0
for i in range(1,M+1):
ans += dp[i][0]
print(ans)