A.Price List
Sol
求和查询
Code
#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
typedef long long LL;
const int N = 100005;
//LL v[N];
inline LL in(LL x=0,char ch=getchar()){ while(ch>'9'||ch<'0') ch=getchar();
while(ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+ch-'0',ch=getchar();return x; }
int main(){
int T,n,m;LL tmp;
for(T=in();T--;){
n=in(),m=in(),tmp=0;
for(int i=1;i<=n;i++) tmp+=in();
// for(int i=1;i<=n;i++) v[i]=in();
for(int i=1;i<=m;i++){
if(in()>tmp) putchar('1');
else putchar('0');
}putchar('\n');
}return 0;
}
#include