题目描述 Byteasar works for the BAJ company, which sells computer games. The BAJ company cooperates with many courier companies that deliver the games sold by the BAJ company to its customers. Byteasar is inspecting the cooperation of the BAJ company wit…
题目大意:给一个数列,每次询问一个区间内有没有一个数出现次数超过一半.有,输出这个数,否则输出$0$ 题解:主席树,查询区间第$\bigg\lfloor\dfrac{len+1}{2}\bigg\rfloor$大,并判断它出现次数是否大于$\Big\lfloor\dfrac{len}{2}\Big\rfloor$ 卡点:无 C++ Code: #include <cstdio> #define maxn 500010 #define N (maxn * 22) int n, m; int…