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个鼠标及其费用,每个鼠标只能使用一遍.在最大化有鼠 ...
随机推荐
- 如何测试本地是否能够正常访问云服务器的 Web 端口
在windows环境下打开DOS命令行 使用telnet命令.例如 telnet www.baidu.com 80 插播一条小知识:DOS下清屏的命令是cls. 首先很不幸,出现了['telnet' ...
- PCI-E调试方式
PCI-E的调试步骤 1.板子插上去之后正常情况下使用lspci 就能看的一个设备 这个设备上存在几个ID,可以根据ID可以确定设备是否识识别到 2.然后就是加载设备的驱动的时候,设备驱动会有VEND ...
- zk reconnect
http://blog.csdn.net/hengyunabc/article/details/41450003 http://blog.csdn.net/hengyunabc/article/det ...
- zf-关于交换工具配置文件,交换的“列名字段”前面加个“0,1,2”的意思。
- ubuntu apt-get update 连接不到指定的源
问题描述: ubuntu apt-get update 连接不到指定的源,修改了几个软件源还是连接不上,同样的软件源在别的机器上都可以正常使用,后来发现每次 sudo apt-get update操作 ...
- 【Tomcat】Tomcat配置之请求字符串编码
默认情况下,如果tomcat中部署的webservice或者web网站需要有中文的请求参数,而这时候我们直接在浏览器中输入中文那么接受到的将是乱码,无法达到我们的需求,这时候我们就需要对Tomcat的 ...
- 转载:数位DP模板
// pos = 当前处理的位置(一般从高位到低位) 2 // pre = 上一个位的数字(更高的那一位) 3 // status = 要达到的状态,如果为1则可以认为找到了答案,到时候用来返回, 4 ...
- [转]LayoutInflater的inflate函数用法
LayoutInflater作用是将layout的xml布局文件实例化为View类对象. 获取LayoutInflater的方法有如下三种: LayoutInflater inflater=(Layo ...
- socket通信的json数据传输与获取
本文是基于scoket通信的tcp来进行数据的json格式传输与获取的. 首先,我们先要下载AsyncSockethttps://github.com/robbiehanson/CocoaAsyncS ...
- Windows编译安装mod_wsgi,配合使用Django+Apahce
编译环境: 均是32位版本 Microsoft Visual Studio 10.0 Microsoft SDKs v7.1 Apache2.4 Python3.4 mod_wsgi-4.5.0 要求 ...