阅读背景:

BestCoder Round #86 解题报告

来源:互联网 

A.Price List

Sol

求和查询

Code

#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;

typedef long long LL;
const int N = 100005;

//LL v[N];

inline LL in(LL x=0,char ch=getchar()){ while(ch>'9'||ch<'0') ch=getchar();
    while(ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+ch-'0',ch=getchar();return x; }
int main(){
    int T,n,m;LL tmp;
    for(T=in();T--;){
        n=in(),m=in(),tmp=0;
        for(int i=1;i<=n;i++) tmp+=in();
//        for(int i=1;i<=n;i++) v[i]=in();
        for(int i=1;i<=m;i++){
            if(in()>tmp) putchar('1');
            else putchar('0');
        }putchar('\n');
    }return 0;
}
#include



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: