水题。

  1. #pragma comment(linker, "/STACK:1024000000,1024000000")
  2. #include<cstdio>
  3. #include<cstring>
  4. #include<cmath>
  5. #include<cstdlib>
  6. #include<algorithm>
  7. #include<vector>
  8. #include<map>
  9. #include<set>
  10. #include<queue>
  11. #include<stack>
  12. #include<iostream>
  13. using namespace std;
  14. typedef long long LL;
  15. const double pi = acos(-1.0), eps = 1e-;
  16. void File()
  17. {
  18. freopen("D:\\in.txt", "r", stdin);
  19. freopen("D:\\out.txt", "w", stdout);
  20. }
  21. inline int read()
  22. {
  23. char c = getchar(); while (!isdigit(c)) c = getchar();
  24. int x = ;
  25. while (isdigit(c)) { x = x * + c - ''; c = getchar(); }
  26. return x;
  27. }
  28.  
  29. int n,a[],sz;
  30.  
  31. int main()
  32. {
  33. scanf("%d",&n);
  34. for(int i=;i<=n;i++) {scanf("%d",&a[i]); if(a[i]==) sz++;}
  35. if(n==)
  36. {
  37. if(a[]==) printf("YES\n");
  38. else printf("NO\n");
  39. }
  40. else
  41. {
  42. if(sz!=n-) printf("NO\n");
  43. else printf("YES\n");
  44. }
  45.  
  46. return ;
  47. }

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. Xcode7修改模块生成网络权限(ATS配置)

    直接找    前往->前往文件夹->然后复制下面的路径填入框内,回车就能看到想要替换的文件夹了 /Applications/Xcode.app/Contents/Developer/Pla ...

  2. Html 嵌入 swf

    1. object + embed       传统的方法 优点:浏览器兼容性好,是 Macromedia 一直以来的官方方法缺点:a.embed 标签是不符合 W3C 的规范的,无法通过验证.当然, ...

  3. 2. Shell 传递参数

    1. 概要 我们可以在执行 Shell脚本时,向脚本传递参数,脚本内获取参数的格式为:$n.n 代表一个数字,1 为执行脚本的第一个参数,2 为执行脚本的第二个参数,以此类推-- #!/bin/bas ...

  4. IOS 第三方库之-MBProgressHUD的使用详解

    转自作者: weidfyr  http://www.aiuxian.com/article/p-3121607.html 1,MBProgressHUD常用属性和用法Demo - (void)test ...

  5. html+javascript实现可拖动可提交的弹出层对话框效果

    本文为大家介绍下使用html+javascript实现可拖动弹出层.对话框.可提交,具体代码如下,感兴趣的朋友可以参考下,希望对大家有所帮助 <!DOCTYPE HTML PUBLIC &quo ...

  6. Java编程中时区和时间相关的问题

    先说一个结论:时间戳是一个和时区无关的东西,在哪里都是一致的!但是转化为字符串之后,就和时区有关系了. 以下为内容: 参考链接:http://m.blog.csdn.net/article/detai ...

  7. JavaScript高级程序设计:第十二章

    DOM1级主要定义的是HTML和XML文档的底层结构.DOM2和DOM3级则在这个结构的基础上引入了更多的交互能力,也支持了更高级的XML特性.为此DOM2和DOM3级分为许多模块,这些模块如下: D ...

  8. hdu_1072_Nightmare(BFS)

    题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1072 题意:给你一个地图,让你在炸弹爆之前找到出口,最初炸弹设定为6,每走一格需要1,中途有地方能让炸 ...

  9. 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 ...

  10. MC 在1分钟图拿出5分钟,15分钟,30分钟,1小时的K线

    using System; using System.Drawing; using System.Linq; using System.Collections; namespace PowerLang ...