mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1001.cpp
This commit is contained in:
parent
3c14a9b5a8
commit
f5369ea995
33
BestCoder/Round-80/1001.cpp
Normal file
33
BestCoder/Round-80/1001.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user