Input is same for both platforms
8 5
10 9 8 7 7 7 5 5
what is this happening? is there something wrong in my code?
Code--->
#include <iostream>
using namespace std;
int main(){
    int n;
    int a[n];
    int k;
    cin>>n>>k;
    int p=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        if(a[i]>0){
            if(a[i]>=a[k-1]){
                p++;
            }
        }
    }
    cout<<p;
    return 0;
}
 
    