题目链接:

A. Fashion in Berland

题意:

思路:

AC代码:

//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath> using namespace std; #define For(i,j,n) for(int i=j;i<=n;i++)
#define mst(ss,b) memset(ss,b,sizeof(ss)); typedef long long LL; template<class T> void read(T&num) {
char CH; bool F=false;
for(CH=getchar();CH<''||CH>'';F= CH=='-',CH=getchar());
for(num=;CH>=''&&CH<='';num=num*+CH-'',CH=getchar());
F && (num=-num);
}
int stk[], tp;
template<class T> inline void print(T p) {
if(!p) { puts(""); return; }
while(p) stk[++ tp] = p%, p/=;
while(tp) putchar(stk[tp--] + '');
putchar('\n');
} //const LL mod=1e9+7;
const double PI=acos(-1.0);
const LL inf=1e18;
const int N=2e5+;
const int maxn=;
const double eps=1e-; int n,a[]; int main()
{
read(n);
int sum=;
For(i,,n)
{
read(a[i]);
sum+=a[i];
}
if(n==)
{
if(a[]==)
cout<<"YES";
else cout<<"NO";
}
else {if(sum==n-)cout<<"YES";
else cout<<"NO";
}
return ;
}

最新文章

  1. PHP会话管理:cookie和session
  2. mybatis2
  3. js队列
  4. CHAP认证原理
  5. 【TYVJ】1359 - 收入计划(二分)
  6. nyist 62 笨小熊
  7. 深入理解Java虚拟机
  8. react native学习1-安装,执行
  9. Makefile中include、-include、sinclude的区别
  10. volatile详解
  11. Percona XtraBackup 核心文档
  12. C#第一课
  13. 正式表达式判断私有 IP 地址
  14. Git Bash上传文件
  15. MFC 字体
  16. python 全栈开发,Day41(线程概念,线程的特点,进程和线程的关系,线程和python 理论知识,线程的创建)
  17. php curl批处理
  18. STM32F105 USB管脚Vbus的处理
  19. 018PHP基础知识——函数(一)
  20. [Swift实际操作]八、实用进阶-(3)闭包在定时任务、动画和线程中的使用实际操作

热门文章

  1. Poi写文件时报java.io.IOException: Read error
  2. hdu3315 /最大权最佳匹配(最大权下尽量不改变次序)(有权田忌赛马类问题)/费用流
  3. Maven的相关问题(一)——settings.xml配置详解
  4. java基础之IO流(二)之字符流
  5. android 获得电池状态
  6. 【spring data jpa】报错如下:Caused by: javax.persistence.EntityNotFoundException: Unable to find com.rollong.chinatower.server.persistence.entity.staff.Department with id 0
  7. 转:使用 SCons 轻松建造程序
  8. (转) SYSTEM_HANDLE_INFORMATION中ObjectTypeIndex的定义
  9. 简单使用 Mvc 内置的 Ioc
  10. 用python编写的简易端口扫描器