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 ...
随机推荐
- Xcode7修改模块生成网络权限(ATS配置)
直接找 前往->前往文件夹->然后复制下面的路径填入框内,回车就能看到想要替换的文件夹了 /Applications/Xcode.app/Contents/Developer/Pla ...
- Html 嵌入 swf
1. object + embed 传统的方法 优点:浏览器兼容性好,是 Macromedia 一直以来的官方方法缺点:a.embed 标签是不符合 W3C 的规范的,无法通过验证.当然, ...
- 2. Shell 传递参数
1. 概要 我们可以在执行 Shell脚本时,向脚本传递参数,脚本内获取参数的格式为:$n.n 代表一个数字,1 为执行脚本的第一个参数,2 为执行脚本的第二个参数,以此类推-- #!/bin/bas ...
- IOS 第三方库之-MBProgressHUD的使用详解
转自作者: weidfyr http://www.aiuxian.com/article/p-3121607.html 1,MBProgressHUD常用属性和用法Demo - (void)test ...
- html+javascript实现可拖动可提交的弹出层对话框效果
本文为大家介绍下使用html+javascript实现可拖动弹出层.对话框.可提交,具体代码如下,感兴趣的朋友可以参考下,希望对大家有所帮助 <!DOCTYPE HTML PUBLIC &quo ...
- Java编程中时区和时间相关的问题
先说一个结论:时间戳是一个和时区无关的东西,在哪里都是一致的!但是转化为字符串之后,就和时区有关系了. 以下为内容: 参考链接:http://m.blog.csdn.net/article/detai ...
- JavaScript高级程序设计:第十二章
DOM1级主要定义的是HTML和XML文档的底层结构.DOM2和DOM3级则在这个结构的基础上引入了更多的交互能力,也支持了更高级的XML特性.为此DOM2和DOM3级分为许多模块,这些模块如下: D ...
- hdu_1072_Nightmare(BFS)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1072 题意:给你一个地图,让你在炸弹爆之前找到出口,最初炸弹设定为6,每走一格需要1,中途有地方能让炸 ...
- LeetCode OJ 82. Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numb ...
- MC 在1分钟图拿出5分钟,15分钟,30分钟,1小时的K线
using System; using System.Drawing; using System.Linq; using System.Collections; namespace PowerLang ...