题目:
代码:
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the angryProfessor function below.
def angryProfessor(k, a):
onTime = 0
for i in range(len(a)):
if a[i] <= 0:
onTime += 1
if onTime < k:
return 'YES'
else:
return 'NO'
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
t = int(input())
for t_itr in range(t):
nk = input().split()
n = int(nk[0])
k = int(nk[1])
a = list(map(int, input().rstrip().split()))
result = angryProfessor(k, a)
fptr.write(result + '\n')
fptr.close()
如果觉得不错,就点赞关注留言~
谢谢各位捧场~