Clarke and puzzle Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 673 Accepted Submission(s): 223 Problem Description Clarke is a patient with multiple personality disorder. One day, Clarke s…
#include<cstdio> #include<algorithm> using namespace std; const int N=100000+3; int x[N], y[N], Y[N], A[N], nums[N]; int C[N]; int cmp(int i,int j){ if(x[i]==x[j])return y[i]<y[j]; return x[i]<x[j]; } int lowbit(int t){return t&(-t);…
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N=250000+6; int C[N<<1],head[N<<1],to[N<<1],nex[N<<1],idx[N],cnt,idx2[N]; int nums=0; void add_edge(int u,int v){ nex[++cnt]=he…
#include<cstdio> #include<algorithm> #include<cstring> using namespace std; const int N=2000000+9; int C[N],flower[N],pre[N],head[N]; int A[N],l[N],r[N],ans[N]; int cmp(int i,int j){ return r[i]<r[j]; } int lowbit(int t){ return t&…
题目描述 Farmer John's N cows, conveniently numbered 1…N, are all standing in a row (they seem to do so often that it now takes very little prompting from Farmer John to line them up). Each cow has a breed ID: 1 for Holsteins, 2 for Guernseys, and 3 for…
Problem Description We believe that every inhabitant of this universe eventually will find a way to live together in harmony and peace; that trust, patience, kindness and loyalty will exist between every living being of this earth; people will find a…
题目传送门 A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 130735 Accepted: 40585 Case Time Limit: 2000MS Description You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One…
N (3N20000)ping pong players live along a west-east street(consider the street as a line segment). Each player has a unique skill rank. To improve their skill rank, they often compete with each other. If two players want to compete, they must choose…
The Battle of Chibi Time Limit: 6000/4000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 2899 Accepted Submission(s): 1043 Problem Description Cao Cao made up a big army and was going to invade the whole South Ch…
题目链接: https://cn.vjudge.net/problem/ZOJ-3279 题目大意: 有1到n 那个level 每一个level有a[i]只蚂蚁两种操作 p a b 把第a个level的蚂蚁数量改成b q a 查询第a只蚂蚁在哪个level里. 解题思路: 用树状数组动态维护前缀和,二分查找第a个蚂蚁即可 要用printf,不然会超时 #include<bits/stdc++.h> using namespace std; ; int tree[maxn], n, a[ma…