Create 1001.cpp

pull/1/head
Kirigaya Kazuto 2016-04-16 20:36:14 +08:00
parent 3c14a9b5a8
commit f5369ea995
1 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,33 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
//
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n;
scanf("%d",&n);
int tmp;
bool haveone=false;
bool havezero=false;
for(int i=0;i<n;i++)
{
scanf("%d",&tmp);
if(tmp==1) haveone=true;
else if(tmp==0) havezero=true;
}
if(haveone&&havezero)
{
printf("YES\n");
}
else
{
printf("NO\n");
}
}
return 0;
}