BestCoder Round #80A

news/2024/10/29 2:25:50/

Lucky

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 507    Accepted Submission(s): 298



判断0和1是否存在;
Problem Description
     Chaos August likes to study the lucky numbers.

     For a set of numbers S,we set the minimum non-negative integer,which can't be gotten by adding the number in S,as the lucky number.Of course,each number can be used many times.

     Now, given a set of number S, you should answer whether S has a lucky number."NO" should be outputted only when it does have a lucky number.Otherwise,output "YES".

Input
     The first line is a number T,which is case number.

     In each case,the first line is a number n,which is the size of the number set.

     Next are n numbers,means the number in the number set.

    1n105,1T10,0ai109 .

Output
     Output“YES”or “NO”to every query.

Sample Input
  
1 1 2

Sample Output
  
NO

Source
BestCoder Round #80

Recommend
wange2014   |   We have carefully selected several similar problems for you:   5669  5668  5667  5664  5663

#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
using namespace std;int main()
{int t,n;cin>>t;int x;while(t--){int flag1=0,flag0=0;cin>>n;for(int i=0;i<n;i++){cin>>x;if(x==1)flag1=1;else if(x==0)flag0=1;}if(flag1&&flag0)printf("YES\n");elseprintf("NO\n");}return 0;
}



http://www.ppmy.cn/news/459611.html

相关文章

VS SQL 出现%CommonDir%dte80a.olb 的解决方案

VS SQL 出现%CommonDir%dte80a.olb 的解决方案 在网上搜索解决方法的时候&#xff0c;别人就说你从别的电脑复制一个到C:\Program Files\Common Files\microsoft shared\MSEnv路径就行了&#xff0c;为啥我的不行&#xff0c;经过一系列查资料&#xff0c;发现olb文件需要注…

Codeforces 80A Panoramix's Prediction

题意&#xff1a; 给你两个数n,m问你是不是相邻的质素&#xff0c;2<n,m<50。 思路&#xff1a; n,m范围才50&#xff0c;直接打表&#xff0c;判断下就可以了。 #include<cstdio>int prime[]{2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,100000000};int main(){…

r3 3100和i3 10100 哪个好

i3-10100为4核8线程&#xff0c;基础频率为3.6GHz&#xff0c;睿频可达4.3GHz&#xff0c;热功耗为65W&#xff0c;带UHD630核显。 选r3 3100还是r3 3100这些点很重要!看完你就知道了 https://list.jd.com/list.html? AMD锐龙R3 3100采用了目前最先进的7纳米工艺制程的Zen2架…

Python有何缺点

转自&#xff1a;微点阅读 https://www.weidianyuedu.com Python 现在如此火爆&#xff0c;已发展成为一种非常通用的语言&#xff0c;无论是从入门级选手到专业技术数据挖掘、科学计算、图像处理、人工智能&#xff0c;Python 都可以胜任。它会是未来的编程语言吗&#xff1f;…

r3 3100和r5 2600哪个好

AMD锐龙R3 3100采用了目前最先进的7纳米工艺制程的Zen2架构&#xff0c;采用依然基于AM4接口设计&#xff0c;这也是AMD良心的一面&#xff0c;方便锐龙平台老用户进行升级。 选r3 3100还是r5 2600 这些点很重要!看完你就知道了 https://list.jd.com/list.html? R3 3100拥有4…

Python的eval()和int()的几点区别和性能差异

tags: Python Tips 写在前面 今天刷几道关于数的运算的题, 我发现了一个很匪夷所思的问题: 两段几乎完全一样的代码, 其运行时间差异怎么会如此之大呢?(题目:415. 字符串相加 - 力扣&#xff08;LeetCode&#xff09;) # 我的代码 class Solution:def addStrings(self, nu…

郭天祥 新概念51单片机C语言教程.入门、提高、开发.pdf下载地址

下载地址&#xff1a; 郭天祥 新概念51单片机C语言教程.入门、提高、开发.pdf下载地址

五月天歌曲下载【专辑整理版】

1999_第一张创作专辑.zip: 下载地址 2000_愛情萬歲.zip: 下载地址 2001_人生海海.zip: 下载地址 2003_時光機.zip: 下载地址 2004_神的孩子都在跳舞.zip: 下载地址 2006_為愛而生.zip: 下载地址 2008_后青春期的诗.zip: 下载地址 2011_1_第二人生 (末日版).zip: 下载地址 2011_…