BITFRENZY

a blog dedicated to technology and programming to shape nation's future.

Breaking

Post Top Ad

Thursday, May 16, 2019

Angry professor Hackerrank solution in c

#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<math.h>
int main()
{
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
int c=0;
int t;
int k;
scanf("%d %d",&t,&k);
int a[t];
for(int j=0;j<t;j++)
{
scanf("%d",&a[j]);
if(a[j]<=0)
c++;
}
if(c>=k)
printf("NO\n");
else
printf("YES\n");
}
return 0;
}



No comments:

Post a Comment

Post Top Ad

Your Ad Spot

Pages