Price List

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/131072 K (Java/Others)
Total Submission(s): 296    Accepted Submission(s): 192

Problem Description
There are n

shops numbered with successive integers from 1

to n

in Byteland. Every shop sells only one kind of goods, and the price of the i

-th shop's goods is vi

.

Every day, Byteasar will purchase some goods. He will buy at most one piece of goods from each shop. Of course, he can also choose to buy nothing. Back home, Byteasar will calculate the total amount of money he has costed that day and write it down on his account book.

However, due to Byteasar's poor math, he may calculate a wrong number. Byteasar would not mind if he wrote down a smaller number, because it seems that he hadn't used too much money.

Please write a program to help Byteasar judge whether each number is sure to be strictly larger than the actual value.

 
Input
The first line of the input contains an integer T

(1≤T≤10)

, denoting the number of test cases.

In each test case, the first line of the input contains two integers n,m

(1≤n,m≤100000)

, denoting the number of shops and the number of records on Byteasar's account book.

The second line of the input contains n

integers v1,v2,...,vn

(1≤vi≤100000)

, denoting the price of the i

-th shop's goods.

Each of the next m

lines contains an integer q

(0≤q≤1018)

, denoting each number on Byteasar's account book.

 
Output
For each test case, print a line with m

characters. If the i

-th number is sure to be strictly larger than the actual value, then the i

-th character should be '1'. Otherwise, it should be '0'.

 
Sample Input
1
3 3
2 5 4
1
7
10000
 
Sample Output
001
 
Source
 
Recommend
wange2014   |   We have carefully selected several similar problems for you:  5808 5807 5806 5805 5804 
 
唉,昨晚只做出来一个题。
 
代码:
#include <iostream>
#include <cstdio> using namespace std; int main()
{
int t;
int n,m;
int v=;;
int sum=;
int jilu[];
int jieguo[];
scanf("%d",&t);
while(t--){
sum=;
scanf("%d %d",&n,&m);
for(int i=;i<n;i++){
scanf("%d",&v);
sum+=v;
}
for(int j=;j<m;j++){
scanf("%d",&jilu[j]);
}
for(int j=;j<m;j++){
if(jilu[j]>sum){
printf("");
}else{
printf("");
}
}
printf("\n"); }
return ;
}

Price List的更多相关文章

  1. 简明外贸报价单(Price List)范本

    简明外贸报价单(Price List)范本 简明外贸报价单(Price List)范本 报价单 Price List 报价日期:年 月   日 Supplier Address 供应商 公司地址 Co ...

  2. CodeForces 219B Special Offer! Super Price 999 Bourles!

    Special Offer! Super Price 999 Bourles! Time Limit:1000MS     Memory Limit:262144KB     64bit IO For ...

  3. graph-tool文档(一)- 快速开始使用Graph-tool - 2.属性映射、图的IO和Price网络

    目录: 属性映射 -- 内部属性映射 图的I/O 构建一个 Price网络(例) 名词解释: Property maps:属性映射 PropertyMap:一个类 scalar value types ...

  4. 在magneto系统中输出tier price的最小值

    2012年6月16日星期六 Asia/Shanghai上午11时39分22秒 有的时候,我们想输出产品的tier price 的最小值!如图: 下面是解决的办法: 1. 在catalog/produc ...

  5. Amazon教程:刚买就降价!避免损失,申请PRICE MATCH(价格保护)的方法

    Amazon的商品价格波动频繁,虽然老白通常都在价格较低的时机向大家推荐,但是经常有降了又降的情况,刚下的单还没到手就又降价了,这种滋味肯定不好受.Amazon客服明确告诉老白一周内降价都可以申请PR ...

  6. VKP5 Price Calculation – List Variant & KZPBL (Delete site level)

    List Variant: Configuration in Logistic General –> Retail Pricing –> Sales Price Calculation – ...

  7. 1106. Lowest Price in Supply Chain (25)

    A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone invo ...

  8. 1090. Highest Price in Supply Chain (25)

    时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A supply chain is a network of r ...

  9. OM Price Lists

      --select * --from org_organization_definitions; --execute fnd_client_info.set_org_context(111); -- ...

随机推荐

  1. python_元组

    元组 元组是用圆括号括起来的,其中的元素之间用逗号隔开.(都是英文半角) >>># 变量引用 str >>> s = "abc" >> ...

  2. 常用sql,在做项目时用mysqlWorkBeach里面自动生成的

    -- 修改表中的字段的长度ALTER TABLE `sfkbbs`.`sfk_father_module` CHANGE ) NULL DEFAULT NULL COMMENT '父板块名字' ; 在 ...

  3. 洛谷P3386 【模板】二分图匹配

    匈牙利算法模板 /*by SilverN*/ #include<algorithm> #include<iostream> #include<cstring> #i ...

  4. DLUTOJ #1306 Segment Tree?

    Description 有一个N个整数的序列(每个数的初值为0).每个数都是整数.你有M次操作.操作有两种类型: ——Add  Di  Xi 从第一个数开始每隔Di 个位置增加Xi ——Query L ...

  5. hihocoder 1196 高斯消元.二

    传送门 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 在上一回中,小Hi和小Ho趁着便利店打折,买了一大堆零食.当他们结账后,看到便利店门口还有其他的活动. 店主:买了 ...

  6. PHP利用Filesystem函数实现操作缓存(生成,获取,删除操作)

    <?php class File{ //$key 相当于缓存文件的文件名 //$value 缓存数据 private $_dir;//定义默认路径 const EXT='.txt'; publi ...

  7. Java初学(五)

    一.成员变量和局部变量区别(成员变量默认为包内访问权限,即使是子类,不在一个包内也无法访问) 1.在类中的位置不同 成员变量:在类中方法外: 局部变量:在方法定义中或者方法声明上 2.在内存中的位置不 ...

  8. static NSString *ID的改进

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPa ...

  9. input file美化

    <style> a{display:inline-block; width:100px; height:40px; position:relative; overflow:hidden;} ...

  10. linux下搭建Nginx

    Linux上搭建nginx,及简单配置  在上家公司都是运维安装nginx,到新公司后代码开发完成部署测试服务器要求自己装nginx,研究了好久安装好之后,到正式上线还要自己安装,索性把安装步骤自己记 ...