CodeForces 609A USB Flash Drives
水题
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std; const int maxn=+;
int a[maxn]; int main()
{
int n,m;
while(~scanf("%d%d",&n,&m))
{
for(int i=; i<=n; i++) scanf("%d",&a[i]);
sort(a+,a++n);
int ans=;
for(int i=n; i>=; i--)
{
ans++;
m=m-a[i];
if(m<=) break;
}
printf("%d\n",ans);
}
return ;
}
CodeForces 609A USB Flash Drives的更多相关文章
- codeforce 609A - USB Flash Drives
排序水题 #include<iostream> #include<cstdlib> #include<cstdio> #include<algorithm&g ...
- Codeforces Educational Codeforces Round 3 A. USB Flash Drives 水题
A. USB Flash Drives 题目连接: http://www.codeforces.com/contest/609/problem/A Description Sean is trying ...
- CF# Educational Codeforces Round 3 A. USB Flash Drives
A. USB Flash Drives time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- CodeForce---Educational Codeforces Round 3 USB Flash Drives (水题)解题报告
对于这题明显是用贪心算法来解决问题: 下面贴出笔者的代码: #include<cstdio> #include<iostream> #include<algorithm& ...
- 【Henu ACM Round#17 B】USB Flash Drives
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 排序,逆序.贪心选较大的就好. [代码] #include <bits/stdc++.h> #define ll lon ...
- WinSetupFromUSB – Install Windows XP from USB Flash Drive
http://myeeeguides.wordpress.com/2008/11/15/winsetupfromusb-install-windows-xp-from-usb-flash-drive/ ...
- UEFI Bootable USB Flash Drive - Create in Windows(WIN7 WIN8)
How to Create a Bootable UEFI USB Flash Drive for Installing Windows 7, Windows 8, or Windows 8.1 In ...
- LPCScrypt, DFUSec : USB FLASH download, programming, and security tool, LPC-Link 2 Configuration tool, Firmware Programming
What does this tool do? The LPC18xx/43xx DFUSec utility is a Windows PC tool that provides support f ...
- Codeforces 762B USB vs. PS/2 贪心
Codeforces 762B 题目大意: 有a台只有USB接口的电脑,b台PS/2接口的电脑,c台两种接口都有的电脑.每台电脑只用装一个鼠标.给出n个鼠标及其费用,每个鼠标只能使用一遍.在最大化有鼠 ...
随机推荐
- 【我与一道水题的抗争之路】 哈理工2323 Emirp(反素数)
题目: http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=2323 1,打表的姿势不对. ...
- javascript 浏览器
hashchange事件 window.location.hash.slice(1) 添加和修改历史记录条目LINKHTML5引进了history.pushState()方法和history.repl ...
- 从运营商小广告到HTTPS
相信很多人都试过这样的经历,浏览一个正常的网站时,右下突然角弹出一堆小广告,而且这些广告的内容和你浏览的网站格格不入: 前几天还有某微博用户爆料访问github时居然也有广告: 又或者,你有没有试过因 ...
- Apache配置详解【转】
http站点要这样配置服务器才安全 2016-07-29 10:32 主机(站点)配置 一个站点的2个核心信息为: 主机名(服务器名/站点名): ServerName 服务器名 站点位置(站点目录路径 ...
- linux 进程监控和自动重启的简单实现(转)
目的:linux 下服务器程序会因为各种原因dump掉,就会影响用户使用,这里提供一个简单的进程监控和重启功能. 实现原理:由定时任务crontab调用脚本,脚本用ps检查进程是否存在,如果不存在则重 ...
- linq中first() firstordefault() last() lastOrDefault() single() singleOrDeafult
一.firstordefault() 和 first() class Program { static void Main(string[] args) { List<Emp> list ...
- replication factor
http://www.tuicool.com/articles/RJbIBj 关于Hadoop中replication factor解惑 时间 2014-06-09 08:00:50 ITeye ...
- 2.10 工具使用 after effects(图形视频处理软件)
................... ..................... 暂无 教程素材网 http://img.yipinsucai.com/
- OpenGL网络资源
转 十大OpenGL教程 1.http://nehe.gamedev.net/这个是我觉得全世界最知名的OpenGL教程,而且有网友将其中48个教程翻译成了中文http://www.owlei.com ...
- POJ 2975 Nim 尼姆博弈
题目大意:尼姆博弈,求先手必胜的情况数 题目思路:判断 ans=(a[1]^a[2]--^a[n]),求ans^a[i] < a[i]的个数. #include<iostream> ...