n, k = map(int, raw_input().strip().split() ) seq = map(int, raw_input().strip().split() ) score = seq[k - 1] if score == 0: counter = 0 for i in range(0, k): if seq[i] > score: counter += 1 print counter else: counter = k for i in range(k, n): if seq[i] >= score: counter += 1 else: break print counter
No comments:
Post a Comment