Advertisement
rengetsu

Codeforces_158A

Jul 18th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. //Codeforces Round 158A
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     int n, k, a[101], answ=0;
  7.     cin >> n >> k;
  8.     for(int i=0;i<n;i++)
  9.         cin >> a[i];
  10.     for(int i=0;i<n;i++)
  11.         if(a[i]>=a[k-1] && a[i]!=0) answ++;
  12.     cout<<answ;
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement