标签:
题目链接:
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/65536 K (Java/Others)
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <queue> #include <cmath> using namespace std; typedef long long ll; const ll mod=1e9+7; const int N=1e5+10; int n,a[N]; int main() { int t; scanf("%d",&t); while(t--) { scanf("%d",&n); int flag1=0,flag2=0; for(int i=1;i<=n;i++) { scanf("%d",&a[i]); if(a[i]==1)flag1=1; if(a[i]==0)flag2=1; } if(flag1&&flag2)printf("YES\n"); else printf("NO\n"); } return 0; }
标签:
原文地址:http://www.cnblogs.com/zhangchengc919/p/5399843.html