import java.util.Scanner;
public class Next_Round {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int k = scanner.nextInt();
int j = 0;
int[] a = new int[n];
for(int i = 0; i < n; i++) {
a[i] = scanner.nextInt();
}
//第k位的乘积
k = a[k-1];
for(int i = 0; i < n; i++) {
if(a[i] > 0 && a[i] >= k) j++;
else break;
}
System.out.println(j);
}
}
Coderforces Next_Round
最新推荐文章于 2022-06-06 13:30:27 发布