Codeforces next round solution in C,Python
QUESTION
158A. Next Round Solution solution in C
#include<stdio.h>
int main()
{
int n,i,k,count=0;
int a[100];
scanf(“%d%d”,&n,&k);
for(i=0;i<n;i++){
scanf(“%d”,&a[i]);}
k=k-1;
for(i=0;i<n;i++){
if(a[i]>=a[k]&&a[i]>0){
count++;
}
}
printf("%d\n",count);
return 0;
}
158A. Next Round Solution in Python
n,k = map(int,raw_input().split())
L = map(int,raw_input().split())
temp = L[k-1]
count=0
for i in range(0,len(L)):
if L[i]>=temp and L[i]>0 :
count+=1
print count
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?