题解:因为是要求一定“记多了”,也就是记录的值大于总和的最大值
注意:sum取long long
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#define mem(x,y) memset(x,y,sizeof(x))
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
#define bug puts("===========");
#define zjc puts("");
const double pi=(acos(-1.0));
const double eps=1e-8;
const ll INF=1e18+10;
const ll inf=1e9+10;
const int mod=1e9+7;
const int maxn=1001;
/*=======================================*/
int main()
{
int T_T;
scanf("%d",&T_T);
while(T_T--){
int n,m;
ll sum=0;
scanf("%d%d",&n,&m);
for(int i=0;i<n;i++){
int a;
scanf("%d",&a);
sum+=a;
}
for(int i=0;i<m;i++){
ll a;
scanf("%I64d",&a);
if(a>sum) putchar('1');
else putchar('0');
}
puts("");
}
return 0;
}