题目链接
直接计算即可
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<map>
#include<set>
#include<cstdlib>
#include<vector>
using namespace std;
#define cl(a,b) memset(a,b,sizeof(a))
#define LL long long
#define pb push_back
#define gcd __gcd
#define For(i,j,k) for(int i=(j);i<k;i++)
#define lowbit(i) (i&(-i))
#define _(x) printf("%d\n",x)
const int maxn = 1e6+200;
const int inf = 1 << 28;
int main() {
int T;
scanf("%d",&T);
int n,m;
while(T--) {
scanf("%d%d",&n,&m);
LL sum = 0;
for(int i=0; i<n; i++) {
LL x;
scanf("%lld",&x);
sum+=x;
}
for(int i=0; i<m; i++) {
LL t;
scanf("%lld",&t);
if(t>sum)printf("1");
else printf("0");
}
puts("");
}
return 0;
}