Bestcoder Round #86 1001

Source: Internet
Author: User

Link http://acm.hdu.edu.cn/showproblem.php?pid=5804

Test instructions: give you some store and his commodity price, and then give you an account book, ask you remember big is 1, otherwise is 0

Solution: Simulation, attention to test data size

#include <stdio.h>//#include <bits/stdc++.h> #include <string.h> #include <iostream> #include <math.h> #include <sstream> #include <set> #include <queue> #include <map> #include < vector> #include <algorithm> #include <limits.h> #define INF 0x3fffffff#define inf 0x3f3f3f3f#define Lson  L,m,rt<<1#define Rson m+1,r,rt<<1|1#define LL long long#define ULL unsigned long longusing namespace Std;int N,m;long long A[1000005];long long Q,p;long long B[1000005],e[1000005],c[1000005];long long sum=0;int t;long long MAXN1,M     Axn2;int Main () {int t;     scanf ("%d", &t);         while (t--) {sum=0;         scanf ("%d%d", &n,&m);             for (int i=1;i<=n;i++) {//cin>>a[i];             scanf ("%lld", &a[i]);         Sum+=a[i];             } for (int i=1;i<=m;i++) {scanf ("%lld", &b[i]);    if (Sum>=b[i]) {printf ("0");         } else {printf ("1");     }} puts (""); } return 0;}

  

Bestcoder Round #86 1001

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.