水题。

#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. tomcat的事件监听

    //事件涉及的三个组件:事件源.事件对象.事件监听器 //一个总的事件监听器接口,所有不同分类的事件监听器都继承这个接口 public interface EventListener {} //例如  ...

  2. tableviewcell滑动显示多个按钮UITableViewRowAction(转载)

    demo截图 ios8 新的属性 typedef NS_ENUM(NSInteger, UITableViewRowActionStyle) { UITableViewRowActionStyleDe ...

  3. ADO.NET 数据访问类查询、属性扩展

    今天,我首先在之前所做的人员管理系统的基础上,利用数据访问类进行了所有人员信息的查询. 主程序代码: List<Users> Ulist = new UsersData().Select( ...

  4. C#第七天

    一 1.继承:我们可能会在一些类中,写一些重要的成员,将这些重复的成员单独的封装到一个类中,作为这些类的父类. Student    Teacher     Driver               ...

  5. tableview选择的时候不要cell的高亮显示样式

    1.若用方法: //-(BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)ind ...

  6. oracle 备份操作流程

    Oracle 库表导出步骤 例如,要导出wcsr用户下的所有表,已知用户名/密码:wcsr/wcsr_woer 首先打开cmd.exe 其次创建备份目录,最好目录不包含空格和中文名 md d:\ora ...

  7. Sublime 3 and Python

    1. 安装Anaconda插件 Ctrl+Shift+P打开控制面板,找到Install Package,回车 在弹出框中输入Anaconda,回车安装即可. 2.配置Anaconda文件 Prefe ...

  8. C#项目转php工作记录

    1.Visual Studio Ultimate 2012 静态激活密钥 RBCXF-CVBGR-382MK-DFHJ4-C69G8 http://blog.csdn.net/jpzy520/arti ...

  9. mysql 表连接

    1.子查询是指在另一个查询语句中的SELECT子句. 例句: SELECT * FROM t1 WHERE column1 = (SELECT column1 FROM t2); 其中,SELECT ...

  10. ECOS运行环境安装(一)

    ECOS为上海商派公司研发的PHP电商框架.详情见 http://www.ec-os.net/doc.html 本文介绍CentOS6.x 64位下安装ECOS1.2运行环境的具体步骤: 1)需要准备 ...