ANGRY PROFESSOR from Hackerrank.com
[restrict …]
#include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> #include <limits.h> #include <stdbool.h> int main() { long long int t,m,i,c,ag,n,w,count; long long int ar[50000]; count = w = 0; scanf(“%lld”,&n); c = 0; do { count = 0; scanf(“%lld %lld”,&t,&m); for(i=0;i<t;i++) { scanf(“%lld”,&ag); if(ag <= 0) count++; } if(count >= m) ar[w++] = 1; else ar[w++] = 0; c++; } while(c<n); for(i=0;i<w;i++) { if(ar[i] == 1) printf(“NO\n”); else printf(“YES\n”); } return 0; }
[/restrict]