Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Codeforces Round 158A
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, k, a[101], answ=0;
- cin >> n >> k;
- for(int i=0;i<n;i++)
- cin >> a[i];
- for(int i=0;i<n;i++)
- if(a[i]>=a[k-1] && a[i]!=0) answ++;
- cout<<answ;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement