排序水题

 #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的更多相关文章

  1. CodeForces 609A USB Flash Drives

    水题 #include<cstdio> #include<cmath> #include<algorithm> using namespace std; +; in ...

  2. 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 ...

  3. 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 ...

  4. CodeForce---Educational Codeforces Round 3 USB Flash Drives (水题)解题报告

    对于这题明显是用贪心算法来解决问题: 下面贴出笔者的代码: #include<cstdio> #include<iostream> #include<algorithm& ...

  5. 【Henu ACM Round#17 B】USB Flash Drives

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 排序,逆序.贪心选较大的就好. [代码] #include <bits/stdc++.h> #define ll lon ...

  6. WinSetupFromUSB – Install Windows XP from USB Flash Drive

    http://myeeeguides.wordpress.com/2008/11/15/winsetupfromusb-install-windows-xp-from-usb-flash-drive/ ...

  7. 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 ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. 编写你的第一个 Django 程序 第1部分

    原地址:http://django-chinese-docs.readthedocs.org/en/latest/intro/tutorial01.html 让我们通过例子来学习. 在本教程中,我们将 ...

  2. fiddler 插件开发

    本文主要讲解使用.net C#语言开发Fiddler插件. 1.在Fiddler 会话列表中添加自定义列 使用FiddlerApplication.UI.lvSessions.AddBoundColu ...

  3. Host Definition

    Description: A host definition is used to define a physical server, workstation, device, etc. that r ...

  4. hdu 4577 X-Boxes 大数

    java水过…… 代码如下: import java.math.*; import java.util.*; public class Main { public static void main(S ...

  5. php获取类的实例变量

    <?php class Page {private $title; //构造函数固定名称为__construct,这样能将php的类构造函数独立于类名,以后修改类名就无需修改构造函数名称 fun ...

  6. 一个隐晦的c++语法问题

    转:http://www.cnblogs.com/lancidie/archive/2013/04/13/3019596.html typedef MyData { int data1; int da ...

  7. python学习笔记七--数据操作符

    一.Python表达式操作符及程序:

  8. ASCII码表详解

    第一部分:ASCII非打印控制字符表 ASCII表上的数字0–31分配给了控制字符,用于控制像打印机等一些外围设备.例如,12代表换页/新页功能.此命令指示打印机跳到下一页的开头.(参详ASCII码表 ...

  9. WinAPI——UnhookWindowsHookEx - 卸掉钩子

    UnhookWindowsHookEx(   hhk: HHOOK {钩子句柄} ): BOOL;    {True/False}

  10. Android开发UI之给ImageView添加蒙版

    ImageView控件添加蒙版, 通过属性:android:tint="" 比如 android:tint="#44ff0000"