View Code #include<stdio.h>#include<string.h>int c[50010];char str[50010];int n,m;int lowbit(int x){ return x&(-x);}void update(int x,int d){ while(x<=n) { c[x]+=d; x+=lowbit(x); }}int sum(int x){ int ans=0; while(x>0) { ans+=c[x]; x-=lowbit(x); } ... Read More
View Code #include<queue>#include<iostream>#include<vector>using namespace std;struct mycmp{ bool operator()(const int &a,const int &b) { return a>b; }};//这里表示从小到大排列,最小的数在队头,随时准备走出队列int main(){ int n,k,val; char str[5]; int count; while(scanf("%d%d",&n,& Read More
Fruit NinjaTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 374Accepted Submission(s): 197Problem DescriptionRecently, dobby is addicted in the Fruit Ninja. As you know, dobby is a free elf, so unlike other elves, he could do whatever he wants.But t Read More