水题。

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi = acos(-1.0), eps = 1e-;
void File()
{
freopen("D:\\in.txt", "r", stdin);
freopen("D:\\out.txt", "w", stdout);
}
inline int read()
{
char c = getchar(); while (!isdigit(c)) c = getchar();
int x = ;
while (isdigit(c)) { x = x * + c - ''; c = getchar(); }
return x;
} int n,a[],sz; int main()
{
scanf("%d",&n);
for(int i=;i<=n;i++) {scanf("%d",&a[i]); if(a[i]==) sz++;}
if(n==)
{
if(a[]==) printf("YES\n");
else printf("NO\n");
}
else
{
if(sz!=n-) printf("NO\n");
else printf("YES\n");
} return ;
}

Codeforces 691A Fashion in Berland的更多相关文章

  1. 【模拟】Codeforces 691A Fashion in Berland

    题目链接: http://codeforces.com/problemset/problem/691/A 题目大意: n个数0或1,要求恰好n-1个1,如果n为1则那个数一定要是1 题目思路: [模拟 ...

  2. codeforces 691A A. Fashion in Berland(水题)

    题目链接: A. Fashion in Berland 题意: 思路: AC代码: //#include <bits/stdc++.h> #include <iostream> ...

  3. Educational Codeforces Round 14 A. Fashion in Berland 水题

    A. Fashion in Berland 题目连接: http://www.codeforces.com/contest/691/problem/A Description According to ...

  4. codeforces 808G Anthem of Berland

    codeforces 808G Anthem of Berland 题面 给定\(s\)串和\(t\)串,字符集是小写字母.\(s\)串中有些位置的值不确定,要求你确定这些位置上的值,使得\(t\)在 ...

  5. CodeForces 164 B. Ancient Berland Hieroglyphs 单调队列

    B. Ancient Berland Hieroglyphs 题目连接: http://codeforces.com/problemset/problem/164/B Descriptionww.co ...

  6. codeforces 644A Parliament of Berland

    A. Parliament of Berland time limit per test 1 second memory limit per test 256 megabytes input stan ...

  7. Codeforces 808G Anthem of Berland - KMP - 动态规划

    题目传送门 传送点I 传送点II 传送点III 题目大意 给定一个字符串$s$,和一个字符串$t$,$t$只包含小写字母,$s$包含小写字母和通配符'?'.询问$t$可能在$s$中出现最多多少次. 原 ...

  8. Codeforces 1 C. Ancient Berland Circus-几何数学题+浮点数求gcd ( Codeforces Beta Round #1)

    C. Ancient Berland Circus time limit per test 2 seconds memory limit per test 64 megabytes input sta ...

  9. CodeForces - 1C:Ancient Berland Circus (几何)

    Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things ...

随机推荐

  1. CentOS 7 安装Python pip

    1 首先安装epel扩展源: sudo yum -y install epel-release 2 然后安装python-pip sudo yum -y install python-pip 3安装完 ...

  2. 重复T次的LIS的dp Codeforces Round #323 (Div. 2) D

    http://codeforces.com/contest/583/problem/D 原题:You are given an array of positive integers a1, a2, . ...

  3. HDU 5933/思维

    题目链接[http://acm.hdu.edu.cn/showproblem.php?pid=5933]; 题意: 给出n堆物品,问能不能分成K个数量相等的堆,如果能分,则最少次数是多少.分的规则为: ...

  4. 如何通过Maven的Jetty插件运行Web工程

    首先建议使用jetty9,因为据官方文档显示,Jetty 7 and Jetty 8 are now EOL (End of Life),如下.但是由于项目使用的版本一般都比较低,这里以jetty8为 ...

  5. touchesBegan: withEvent: <--- with UIScrollView / UIImageView

    touchesBegan: withEvent: / touchesMoved: withEvent: / touchesEnded: withEvent: 等只能被UIView捕获(如有问题请指出对 ...

  6. php中文乱码问题分析及解决办法

    中文乱码问题产生的原因,主要就是字符编码设置问题:             首先,mysql数据库安装的时候字符编码要选择正确,最好选择utf-8比较保险.如果安装时没有设置正确,找到mysql的安装 ...

  7. jquery操作HTML5 的data-*的用法实例分享

    .mm{width:256px; height:200px;} .mm[data-name='张含韵']{background:url(http://image.zhangxinxu.com/imag ...

  8. nodejs package.json详细解读

    package.json详细内容 它是这样一个json文件(注意:json文件内是不能写注释的,复制下列内容请删除注释): JavaScript { "name": "t ...

  9. mysql命令行操作 添加字段,修改字段

    alter table  t_apply   change column     remarks(原)    apply_remarks(目标)   varchar(100) default '' c ...

  10. csu1010: Water Drinking

    /* 本题的题意: 沙漠中有很多骆驼和一个池塘,0表示池塘,1-N表示骆驼,输入的两个数表示两只骆驼,其中前面的那一头靠近池塘,所有的骆驼队列不交叉不相连,求站在队尾但是离水井最近的骆驼编号 经过分析 ...