Angry Professor
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
int n,k,cnt=0;
cin >> n >> k;
bool f=false;
while(n--)
{
int x;
cin >> x;
if(x <= 0)
{
cnt++;
}
if(cnt >= k)
{
f=true;
}
}
if(f)
{
cout << "NO\n";
}
else
{
cout << "YES\n";
}
}
return 0;
}
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
int n,k,cnt=0;
cin >> n >> k;
bool f=false;
while(n--)
{
int x;
cin >> x;
if(x <= 0)
{
cnt++;
}
if(cnt >= k)
{
f=true;
}
}
if(f)
{
cout << "NO\n";
}
else
{
cout << "YES\n";
}
}
return 0;
}
Comments
Post a Comment