You are viewing a single comment's thread. Return to all comments →
Use this solution in Java : easy and reliable
Scanner in = new Scanner(System.in);
int testcase = in.nextInt();
for(int i = 0; i < testcase; i++)
{
int N = in.nextInt();
int K = in.nextInt();
int count = 0;
while(N > 0)
int s = in.nextInt();
if(s <= 0)
count++;
}
N--;
if(count >= K)
System.out.println("NO");
else
System.out.println("YES");
Seems like cookies are disabled on this browser, please enable them to open this website
Angry Professor
You are viewing a single comment's thread. Return to all comments →
Use this solution in Java : easy and reliable
Scanner in = new Scanner(System.in);
int testcase = in.nextInt();
for(int i = 0; i < testcase; i++)
{
int N = in.nextInt();
int K = in.nextInt();
int count = 0;
while(N > 0)
{
int s = in.nextInt();
if(s <= 0)
{
count++;
}
N--;
}
if(count >= K)
System.out.println("NO");
else
System.out.println("YES");
}