题解 | 数组计数维护
数组计数维护
https://www.nowcoder.com/practice/47ee4c040f1648fc9ef7732d35402676
T = int(input())
for t in range(T):
n, k = map(int, input().split())
s = 0
cnt = 0
a = list(map(int, input().split()))
for i in a:
if i >= k:
s = s + i
if i == 0 and s >= 1:
s = s - 1
cnt = cnt + 1
print(cnt)