Codeforces 691A Fashion in Berland
水题。
#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的更多相关文章
- 【模拟】Codeforces 691A Fashion in Berland
题目链接: http://codeforces.com/problemset/problem/691/A 题目大意: n个数0或1,要求恰好n-1个1,如果n为1则那个数一定要是1 题目思路: [模拟 ...
- codeforces 691A A. Fashion in Berland(水题)
题目链接: A. Fashion in Berland 题意: 思路: AC代码: //#include <bits/stdc++.h> #include <iostream> ...
- Educational Codeforces Round 14 A. Fashion in Berland 水题
A. Fashion in Berland 题目连接: http://www.codeforces.com/contest/691/problem/A Description According to ...
- codeforces 808G Anthem of Berland
codeforces 808G Anthem of Berland 题面 给定\(s\)串和\(t\)串,字符集是小写字母.\(s\)串中有些位置的值不确定,要求你确定这些位置上的值,使得\(t\)在 ...
- CodeForces 164 B. Ancient Berland Hieroglyphs 单调队列
B. Ancient Berland Hieroglyphs 题目连接: http://codeforces.com/problemset/problem/164/B Descriptionww.co ...
- codeforces 644A Parliament of Berland
A. Parliament of Berland time limit per test 1 second memory limit per test 256 megabytes input stan ...
- Codeforces 808G Anthem of Berland - KMP - 动态规划
题目传送门 传送点I 传送点II 传送点III 题目大意 给定一个字符串$s$,和一个字符串$t$,$t$只包含小写字母,$s$包含小写字母和通配符'?'.询问$t$可能在$s$中出现最多多少次. 原 ...
- 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 ...
- CodeForces - 1C:Ancient Berland Circus (几何)
Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things ...
随机推荐
- ADO.NET 数据访问类查询、属性扩展
今天,我首先在之前所做的人员管理系统的基础上,利用数据访问类进行了所有人员信息的查询. 主程序代码: List<Users> Ulist = new UsersData().Select( ...
- 将数组写入plist文件
data 加载plist [NSBundle mainBundle] [arr writeToURL:<#(NSURL *)#> atomically:<#(BOOL)#>]
- RecyclerView.Adapter
RecyclerView无需多说,是用于替代ListView的新控件.它的适配器在于灵活. 现在有一个需求:需要RecyclerView的item支持点击事件,并且下拉到最后时,显示ProgressB ...
- 如何对Site Settings页面进行定制化 添加一个setting 链接
下面在Site Settings页 >Site Administration里添加一个Ruby Setting 超链接,点击进入到rubySetting.aspx 1.在SharePoint p ...
- Code Blocks 多文件联合编译
code::blocks是一款据说灰常强大的IDE,以前虽然也经常使用,但一没用过高度功能,二来没用它写过工程性的东西,简单点说就是一个以上的源文件并且加入其他非标准的头文件,今天想做一个多文 ...
- 类型“GridView”的控件必须放在具有 runat=server 的窗体标记内?
Response.AddHeader("content-disposition", "attachment;filename=CRM.xls") Respons ...
- OpenLDAP安装与配置
系统:ubuntu 14.04 安装: 1. sudo apt-get install slapd ldap-utils 2. 在1的过程中会让你输了admin密码 配置: 如果安装过,只是想配置Op ...
- web app 基础界面框架搭建
一.问题的产生 基础框架界面如图1所示,目前app流行布局 图1 布局关注点: 1.Title和Footer部分为固定布局position:fixed,存在的争议是android2.x和IOS4一下说 ...
- HDU1272 小希的迷宫 并查集
参考网址:http://blog.sina.com.cn/s/blog_6827ac4a0100nyjy.html 解题思路: 由于这里出现的数字不一定连续的数字都会出现,所以设一个mark来标记数字 ...
- ntity Framework技巧系列之四 - Tip 13 – 15
提示13. 附加一个实体的简单方式 问题: 在早先的一些提示中,我们讨论了使用Attach来加载一个处于未改变(unchanged)状态的东西到ObjectContext从而避免进行查询的开销. 如果 ...