HDU 5804 Price List [Ad Hoc]

博客提供了HDU BestCoder竞赛的题目链接,链接指向http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=721&pid=1001 ,可通过该链接查看相关竞赛题目。

http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=721&pid=1001

#include <iostream>
#include <cstdio>
#include <climits>
using namespace std;
void solve()
{
  int n, m;
  scanf("%d%d", &n, &m);
  unsigned long long s = 0;
  for (int i = 0; i < n; i++) {
    int v;
    scanf("%d", &v);
    if (s <= 1e18 + 1) s += v;
  }
  for (int i = 0; i < m; i++) {
    long long q;
    scanf("%lld", &q);
    if (q > s) printf("1"); else printf("0");
  }
  printf("\n");
}
int main()
{
  //freopen("in", "r", stdin);
  int t;
  scanf("%d", &t);
  while (t--) {
   solve();
  }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值