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. 怎么让alert弹出框的内容可以换行?

    在要点击弹出的地方输入这样的代码: alert("文本框中共有字母a的个数为:"+num+"\n"+"他们在字符串的索引为:"+ind) 就 ...

  2. JAVA中单例模式的几种实现方式

    1 线程不安全的实现方法 首先介绍java中最基本的单例模式实现方式,我们可以在一些初级的java书中看到.这种实现方法不是线程安全的,所以在项目实践中如果涉及到线程安全就不会使用这种方式.但是如果不 ...

  3. 【poj2891】 Strange Way to Express Integers

    http://poj.org/problem?id=2891 (题目链接) 题意 求解线性同余方程组,不保证模数一定两两互质. Solotion 一般模线性方程组的求解,详情请见:中国剩余定理 细节 ...

  4. Sublime Text 3 笔记

    Nearly all of the interesting files for users live under the data directory. The data directory is ~ ...

  5. DLUTOJ #1306 Segment Tree?

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

  6. centos6.3配置MFS服务器

    一.简介 MooseFS(Moose File System,mfs)是一种分布式文件系统,它将数据分布在网络中的不同服务器上,支持FUSE(用户空间文件系统Filesystem in Userspa ...

  7. 51nod 1170 1770 数数字(动态规划)

    解题思路:看到题后,直接想到分成两种情况: ①:a*b >9 这里又分成两种 1. n==1 a*b 直接是一个两位数 求得十位和个位(这里十位和个位不可能相等) 然后如果等于d 则结果=1 2 ...

  8. pthread clean up

    https://www.ibm.com/developerworks/cn/linux/thread/posix_threadapi/part4/ http://www.cnblogs.com/xfi ...

  9. javascript console 函数详解 js开发调试的利器

    Console 是用于显示 JS和 DOM 对象信息的单独窗口.并且向 JS 中注入1个 console 对象,使用该对象 可以输出信息到 Console 窗口中. 使用 alert 不是一样可以显示 ...

  10. 整理时下流行的浏览器User-Agent大全

    总结整理时下流行的浏览器User-Agent大全 此文章转至:http://www.360doc.com/content/12/1012/21/7662927_241124973.shtml 用于学习 ...