Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- long long n,i,a[101],b,x,p,q,k,y;
- string s;
- int main()
- {
- cin >> n >> k;
- for(i=1;i<=n;i++){
- cin >> a[i];
- }
- sort(a+1, a+1+n);
- y=a[k];
- for(i=1;i<=n;i++){
- if(a[i]>=y) b++;}
- cout << b;
- }
Add Comment
Please, Sign In to add comment