codeforces 691A A. Fashion in Berland(水题)
2024-09-04 04:12:18
题目链接:
题意:
思路:
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 ;
}
最新文章
- PHP会话管理:cookie和session
- mybatis2
- js队列
- CHAP认证原理
- 【TYVJ】1359 - 收入计划(二分)
- nyist 62 笨小熊
- 深入理解Java虚拟机
- react native学习1-安装,执行
- Makefile中include、-include、sinclude的区别
- volatile详解
- Percona XtraBackup 核心文档
- C#第一课
- 正式表达式判断私有 IP 地址
- Git Bash上传文件
- MFC 字体
- python 全栈开发,Day41(线程概念,线程的特点,进程和线程的关系,线程和python 理论知识,线程的创建)
- php curl批处理
- STM32F105 USB管脚Vbus的处理
- 018PHP基础知识——函数(一)
- [Swift实际操作]八、实用进阶-(3)闭包在定时任务、动画和线程中的使用实际操作
热门文章
- Poi写文件时报java.io.IOException: Read error
- hdu3315 /最大权最佳匹配(最大权下尽量不改变次序)(有权田忌赛马类问题)/费用流
- Maven的相关问题(一)——settings.xml配置详解
- java基础之IO流(二)之字符流
- android 获得电池状态
- 【spring data jpa】报错如下:Caused by: javax.persistence.EntityNotFoundException: Unable to find com.rollong.chinatower.server.persistence.entity.staff.Department with id 0
- 转:使用 SCons 轻松建造程序
- (转) SYSTEM_HANDLE_INFORMATION中ObjectTypeIndex的定义
- 简单使用 Mvc 内置的 Ioc
- 用python编写的简易端口扫描器