A. Sereja and Mugs
来源:互联网 发布:海牙国际法院知乎 编辑:程序博客网 时间:2024/06/05 20:02
解题说明:此题就是有n个小杯子,把这些杯子中的水往一个大杯子中倒(实际情况是去除一个最大的),判断大杯子是否溢出。
#include<iostream>#include<cstdio>#include<cmath>#include<algorithm>#include<cstdlib>#include<cstring>using namespace std;int main(){ int n,s,m,i,sum=0;int a[101];m=-1; scanf("%d%d",&n,&s); for(i=0;i<n;i++) {scanf("%d",&a[i]);if(m<a[i]) {m=a[i];}sum+=a[i];} if(sum-m<=s) {printf("YES\n");}else {printf("NO\n");}return 0;}
0 0
- A. Sereja and Mugs
- A. Sereja and Mugs
- codeforces Sereja and Mugs
- Codeforces Round #243 (Div. 2)——A. Sereja and Mugs
- A. Sereja and Bottles
- A. Sereja and Dima
- A. Sereja and Coat Rack
- codeforces --A - Sereja and Algorithm
- A. Sereja and Prefixes----模拟
- CodeForces 315A Sereja and Bottles
- Code Forces 380 A. Sereja and Prefixes
- CF 380A Sereja and Prefixes(二分)
- Codeforces 380 A. Sereja and Prefixes
- cf-381A-Sereja and Dima
- Codeforces 367A Sereja and Algorithm
- CodeForces 425A Sereja and Swaps
- Codeforces 425A Sereja and Swaps(暴力)
- CodeForces 380A Sereja and Prefixes
- 大数相加
- net.sf.json.JSONException: 'object' is an array. Use JSONArray instead
- linux僵尸进程产生的原因以及如何避免产生僵尸进程
- ubuntu 安装 sqlite3
- 水晶报表项目运行时 去掉 输入连接数据库密码 的页面
- A. Sereja and Mugs
- 手机定位软件在破案中发挥的作用
- Java工厂模式的精美讲解,讲的非常好
- 多线程(一)_循环接收请求的服务端
- VB.NET自定义标题栏拖动
- 函数指针
- Mac OSX平台搭建Android开发环境(github)
- 写模块代码如何版本控制
- mybatis入门教程 (一)