codeforce 609A - USB Flash Drives
排序水题
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#include<math.h>
using namespace std; int n,m;
int a[]; int main()
{
scanf("%d",&n);
scanf("%d",&m);
for(int i=;i<n;i++)
{
scanf("%d",&a[i]);
}
sort(a,a+n);
int ans=;
int num=;
for(int i=n-;i>=;i--)
{
ans+=a[i];
if(ans>=m)
{
num++;
break;
}
num++;
}
cout<<num<<endl;
return ;
}
codeforce 609A - USB Flash Drives的更多相关文章
- CodeForces 609A USB Flash Drives
水题 #include<cstdio> #include<cmath> #include<algorithm> using namespace std; +; in ...
- 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 ...
- 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 ...
- 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 ...
- Rufus-Create bootable USB drives the easy way
Rufus Create bootable USB drives the easy way Rufus is a utility that helps format and create bootab ...
随机推荐
- ExtJS4.2学习(九)属性表格控件PropertyGrid(转)
鸣谢网址:http://www.shuyangyang.com.cn/jishuliangongfang/qianduanjishu/2013-11-15/178.html ------------- ...
- AndroidManifest.xml文件综合详解(转)
一,重要性AndroidManifest.xml是Android应用程序中最重要的文件之一.它是Android程序的全局配置文件,是每个 android程序中必须的文件.它位于我们开发的应用程序的根目 ...
- 认识RGB和YUV
多年来,对于大部分人来说,对图形信号的认识不外有三种:射频信号,复合视频信号,S视频信号.射频信号是由复合视频信号调到高频上,普通电视机的天线输入信号用于射频信号,复合视频信号的输入出是用RGA端子. ...
- hbase集群在启动的时候找不到JAVA_HOME的问题
hbase集群在启动的时候找不到JAVA_HOME的问题,启动集群的时候报错信息如下: root@master:/usr/local/hbase-/bin# ./start-hbase.sh star ...
- ZOJ Monthly, November 2014
做了一次月赛,没想到这么难,加上后来补上的题目也只有3个题.第一名也只有4个题啊啊啊啊~.其中两道还是水题.留坑慢慢补上来. 3832 Tilt Cylinder 给定如图所示有盖圆柱体,R,H,水面 ...
- *JRebel 热部署
Jrebel是一套商业Java开发软件,可快速实现热部署,节省大量重启时间,提高开发效率. 去IDEA的插件官网下载插件:http://plugins.jetbrains.com/plugin/444 ...
- RedMine项目管理系统安装问题(Windows版一键安装包)
安装准备: 操作环境:VMware10 下安装的windows10 系统 使用软件:<bitnami-redmine---windows-installer.exe> 问题描述: 安装过程 ...
- 对于eclipse新建maven工程需要注意的地方。
新建项目的时候,如果想配置默认的maven的jre为1.6或者别的. http://hi.baidu.com/hi_hi/item/765ec8bbc49880d384dd79d1 1.cmd命令建立 ...
- Python爬虫和情感分析简介
摘要 这篇短文的目的是分享我这几天里从头开始学习Python爬虫技术的经验,并展示对爬取的文本进行情感分析(文本分类)的一些挖掘结果. 不同于其他专注爬虫技术的介绍,这里首先阐述爬取网络数据动机,接着 ...
- Tomcat 配置问题总结
本人是一个前端屌丝儿,最近没事研究了一下tomcat的部署问题,一下列几个实用的小技能(直接上干货了,不赘述): 1,路径引用部署 在tomcat目录下的conf/Catalina/localhost ...