码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-08-07 23:11:33      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:

分析:大于总和输出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

 

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

标签:

原文地址:http://www.cnblogs.com/shuguangzw/p/5747388.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!