只需和总和比较即可。

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi=acos(-1.0),eps=1e-;
void File()
{
freopen("D:\\in.txt","r",stdin);
freopen("D:\\out.txt","w",stdout);
}
inline int read()
{
char c = getchar(); while(!isdigit(c)) c = getchar();
int x = ;
while(isdigit(c)) { x = x * + c - ''; c = getchar(); }
return x;
} int T,n,m,b; int main()
{
scanf("%d", &T);
while (T--)
{
scanf("%d%d", &n, &m);
LL sum = ;
for(int i=;i<=n;i++)
{
LL b;
scanf("%I64d", &b);
sum=sum+b;
}
while (m--)
{
LL x;
scanf("%I64d", &x);
if(x>sum) printf("");
else printf("");
}
printf("\n");
}
return ;
}

HDU 5804 Price List的更多相关文章

  1. HDU 5808 Price List Strike Back bitset优化的背包。。水过去了

    http://acm.hdu.edu.cn/showproblem.php?pid=5808 用bitset<120>dp,表示dp[0] = true,表示0出现过,dp[100] = ...

  2. 【HDU 5808】 Price List Strike Back (整体二分+动态规划)

    Price List Strike Back There are nn shops numbered with successive integers from 11 to nn in Bytelan ...

  3. hdu 2191 珍惜现在,感恩生活

    链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=2191 思路:多重背包模板题 #include <stdio.h> #include ...

  4. hdu 3401 单调队列优化DP

    Trade Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  5. hdu 3449 有依赖性的01背包

    题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=3449  Consumer Description FJ is going to do so ...

  6. hdu 2191 多重背包 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活

    http://acm.hdu.edu.cn/showproblem.php?pid=2191 New~ 欢迎“热爱编程”的高考少年——报考杭州电子科技大学计算机学院关于2015年杭电ACM暑期集训队的 ...

  7. hdu 2844 多重背包coins

    http://acm.hdu.edu.cn/showproblem.php?pid=2844 题意: 有n个硬币,知道其价值A1.....An.数量C1...Cn.问在1到m价值之间,最多能组成多少种 ...

  8. HDU 3401 Trade dp+单调队列优化

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3401 Trade Time Limit: 2000/1000 MS (Java/Others)Mem ...

  9. HDU 1864最大报销额 01背包问题

    B - 最大报销额 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit St ...

随机推荐

  1. HDU 5839 Special Tetrahedron

    HDU 5839 Special Tetrahedron 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5839 Description Given n ...

  2. WEB服务器:Apache、Tomcat、JBoss、WebLogic、Websphere、IIS的区别与关系

    1)Apache  免费,世界使用排名第一的Web服务器.它可以运行在几乎所有广泛使用的计算机平台上.Apache的特点是简单.速度快.性能稳定,并可做代理服务器来使用.Apache是以进程为基础的结 ...

  3. python报错Could not open PYTHONSTARTUP

    root@liqian-python:/pythonShare/monitor/m_server/core# pythonPython 2.7.10 (default, Oct 14 2015, 16 ...

  4. Spring MVC(二)

    spring mvc工作流 1A)客户端发出http请求,只要请求形式符合web.xml 文件中配置的*.action的话,就由DispatcherServlet 来处理. 1B)Dispatcher ...

  5. JavaScript 作用域 匿名函数 模仿块级作用域(私有作用域)

    作用域 对于有块级作用域的语言来说,for语句中定义并初始化的变量i在循环外是无法访问的. 而javascript没有块级作用域,for语句中定义的变量i在循环结束后,依旧会存在于循环外部的执行环境( ...

  6. Calendar时间类型数据设置

    Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DATE, -1); calendar.set(Calendar.H ...

  7. DOM对象和JQuery有什么不同的地方?

    jQuery对象和DOM对象使用说明,需要的朋友可以参考下.1.jQuery对象和DOM对象第一次学习jQuery,经常分辨不清哪些是jQuery对象,哪些是 DOM对象,因此需要重点了解jQuery ...

  8. C#键盘事件处理

    键盘事件是在用户按下键盘上的一个键的时候发生的,可分为两类.第一类是KeyPress事件,当按下的键表示的是一个ASCII字符的时候就会触发这类事件,可通过他的KeyPressEventArgs类型参 ...

  9. 2016 Technology

    rem 62.5%在chrome谷歌和其他浏览器不一样 http://www.5imoban.net/jiaocheng/div+css/201512191529.html http://blog.c ...

  10. terminal color

    自己喜欢的前背景颜色1: foreground:    ab8d0f        yellow        c4a000        default background:    23292b  ...