1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include<iostream>

using namespace std;

#define MAXP 120

int n, k;

int cnt[MAXP];

int main() {
   cin >> n >> k;
   for(int i = 0; i < n; i++) {
      int pt;
      cin >> pt;
      cnt[MAXP - pt]++;
   }
   int cur = 0;
   for(int i = 0; i < MAXP; i++) {
      cur += cnt[i];
      if(cur >= k) {
         break;
      }
   }
   cout << cur << endl;
}