Codeforces next round solution in C,Python || Codeforces 158A. Next Round Solution

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

Next Problem: Domino piling codeforces solution in c

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
NEW TOXIC ROCKET CYCLE DECK in Clash Royale 2023 Best Deck in Clash Royale Best Deck for Arena 8 in Clash Royale Best Hog deck for Pro players Best Clash Royale Deck