1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#include <cstdio>
using namespace std;

int N, K;
int A[121], ai, ks;

int main() {
	scanf("%d %d", &N, &K);
	for (int i = 0; i < N; ++i) {
		scanf("%d", &ai);
		A[ai]++;
	}

	for (int i = 120; ks < K; --i) {
		ks += A[i];
	}

	printf("%d\n", ks);
}