分析:大于总和输出1
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long long LL; const int N = 1e5+5; int ret[N],T,n,m; int main(){ scanf("%d",&T); while(T--){ scanf("%d%d",&n,&m); LL sum=0; for(int i=1;i<=n;++i){ LL x;scanf("%I64d",&x); sum+=x; } for(int i=1;i<=m;++i){ LL x;scanf("%I64d",&x); if(x>sum)printf("1"); else printf("0"); } printf("\n"); } return 0; }