题目链接

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3959

AC代码

#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <numeric>
#include <sstream> using namespace std;
typedef long long LL; const double PI = 3.14159265358979323846264338327;
const double E = 2.718281828459;
const double eps = 1e-6; const int MAXN = 0x3f3f3f3f;
const int MINN = 0xc0c0c0c0;
const int maxn = 1e2 + 5;
const int MOD = 1e9 + 7; int arr[maxn]; int main()
{
int t;
scanf("%d", &t);
a:
while (t--)
{
int n;
memset(arr, 0, sizeof(arr));
scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%d", &arr[i]);
sort(arr, arr + n);
if (n < 10 || n > 13)
{
cout << "No\n";
goto a;
}
else
{
int MAX = arr[n - 1];
if (MAX == 1)
{
cout << "No\n";
goto a;
}
if (arr[0] != 1 || arr[1] != 1)
{
cout << "No\n";
goto a;
}
else
{
for (int i = 2; i < n; i++)
{
if (arr[i] == MAX)
continue;
else if (arr[i] - arr[i - 1] > 2)
{
cout << "No\n";
goto a;
}
}
}
}
cout << "Yes\n";
}
}

ZOJ 3959 Problem Preparation 【水】的更多相关文章

  1. fzuoj Problem 2182 水题

    http://acm.fzu.edu.cn/problem.php?pid=2182 Problem 2182 水题 Accept: 188    Submit: 277Time Limit: 100 ...

  2. 2017浙江省赛 B - Problem Preparation ZOJ - 3959

    地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3959 题目: It's time to prepare the pr ...

  3. 烟大 Contest1024 - 《挑战编程》第一章:入门 Problem A: The 3n + 1 problem(水题)

    Problem A: The 3n + 1 problem Time Limit: 1 Sec  Memory Limit: 64 MBSubmit: 14  Solved: 6[Submit][St ...

  4. Poj1298_The Hardest Problem Ever(水题)

    一.Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar eve ...

  5. [POJ 1000] A+B Problem 经典水题 C++解题报告 JAVA解题报告

        A+B Problem Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 311263   Accepted: 1713 ...

  6. ZOJ 2723 Semi-Prime ||ZOJ 2060 Fibonacci Again 水水水!

    两题水题: 1.如果一个数能被分解为两个素数的乘积,则称为Semi-Prime,给你一个数,让你判断是不是Semi-Prime数. 2.定义F(0) = 7, F(1) = 11, F(n) = F( ...

  7. zoj Abs Problem

    Abs Problem Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge Alice and Bob is pl ...

  8. HDOJ(HDU) 1898 Sempr == The Best Problem Solver?(水题、、、)

    Problem Description As is known to all, Sempr(Liangjing Wang) had solved more than 1400 problems on ...

  9. Prime Ring Problem(dfs水)

    题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1016 Prime Ring Problem Time Limit: 4000/2000 MS (Jav ...

随机推荐

  1. oracle 数据查询

    1,读取从今天到1个月前之间的数据select * from tablewhere column between add_months(sysdate, -1) and sysdate;

  2. ASP.NET MVC 表单提交多层子级实体集合数据到控制器中

    于遇到了项目中实体类嵌套多层子级实体集合,并且子级实体集合的数据需要提交保存到数据库中的问题.针对此情况需要进行一些特殊的处理才可以将整个 实体类及子级实体集合数据提交表单到控制器中,解决的方法是根据 ...

  3. MySQL 5.6修改data目录

    默认数据存放位置: C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.6\ 打开该位置,即可看见my. ...

  4. Crontab使用方式

    Liunx系统的定时任务需要Crontab来完成 一.添加 添加定时脚本 crontab -e 或者直接编辑/etc/crontab文件进行任务添加 vim /etc/crontab 二.格式 三.举 ...

  5. Java基础12 类型转换与多态(转载)

    类型检查 Java的任意变量和引用经过类型声明(type declaration),才能使用.我们之前见过对象数据.类数据.方法参数.方法返回值以及方法内部的自动变量,它们都需要声明其类型.Java是 ...

  6. 安装IPFS并通过自己的域名访问

    下载go-ipfs_v0.4.18_linux-amd64.tar.gz,我这个是linux,如果没有可以在这里下载: http://www.froms.top:8282/ipfs/QmZs9HdSS ...

  7. Python 爬虫实战2 百度贴吧帖子

    爬取百度贴吧的帖子.与上一篇不同的是,这次我们需要用到文件的相关操作. 本篇目标 对百度贴吧的任意帖子进行抓取 指定是否只抓取楼主发帖内容 将抓取到的内容分析并保存到文件 1.URL格式的确定 首先, ...

  8. redhat6.5安装postgresql8.4数据库

    Redhat6.5安装postgresql8.4数据库 step1 先移除原有的postgresql数据库(如果有),否则直接跳过 rpm -qa | grep postgresql* rpm -ev ...

  9. Unity3D学习笔记——IDE菜单栏

    一:菜单栏: 1.File: 2.Edit: 3.Assets: 4.GameObject: 5.Component: 6.Window: 7.Help:

  10. 深入了解UIAutomation 的API

    有关UiAUiAutomation的API对象的文件名称. 1.UIAutomation中的对象都是以UIA#####开头的出现的.eg:UIAButton 2.有关Logger对象负责日志的输出 U ...