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 ...
随机推荐
- redis的适应场景
redis应用场景: 1.对数据高并发读写 2.对海量数据的高效存储和访问 3.对数据的高可扩展性和高可用性 做分布式扩展很简单,因为没有固定的表结构 redis介绍: redis是一个key-val ...
- vs打开项目,创建虚拟目录,提示权限不足无法写入配置文件
如题,从源代码管理器上获取下来程序后,自己打开始,提示如题,尝试过以管理员启动vs,给目录权限提升,修改csproj项目配置文件(修改userIIS节点)and so on,无意间在用别的文档编辑器编 ...
- 《实战Java高并发程序设计》pdf
花了我五元大洋,需要的拿去吧.百度云盘:https://pan.baidu.com/s/1o8bESY2
- SELinux Policy Macros
参考:http://selinuxproject.org/page/NB_RefPolicy Directory Macros macro expansion getattr_dir_perms ge ...
- json处理三部曲之第三曲:利用Gson处理json
需要导入gson-xxx.jar包 <dependency> <groupId>com.google.code.gson</groupId> <artifac ...
- Tsung记录
1.提高Tsung登录用户数 ulimit -n (65530)修改系统最大连接数,Tsung压力机和服务器都需要更改
- HDU 5798 Stabilization
方法太厉害了....看了官方题解的做法....然后...想了很久很久才知道他想表达什么.... #pragma comment(linker, "/STACK:1024000000,1024 ...
- 开启真机的View Server引入HierarchyViewer/By写monkeyrunner自动化测试脚本
其实相关文章网上也有不少了,不过在真机上开启View Server的中文文章好像只有一篇,前段时间按照这篇文章的内容,并结合英文源文去hack我的Nexus S(4.1.2)也走了一点弯路.现在总结一 ...
- classname 就是在css上添加类,然后js的类名等于
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" ...
- 决策树J48算法
1.J48原理 基于从上到下的策略,递归的分治策略,选择某个属性放置在根节点,为每个可能的属性值产生一个分支,将实例分成多个子集,每个子集对应一个根节点的分支,然后在每个分支上递归地重复这个过程.当所 ...