HDU5804 Price List (BestCoder Round #86 A)水题

分析:大于总和输出1

#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;
}
View Code

 

posted @ 2016-08-07 21:37  shuguangzw  阅读(192)  评论(0编辑  收藏  举报