摘要: 分块预处理出[i,j]块内的答案以及数字出现次数,查询时向两边转移,用树状数组维护,复杂度$O((n+m)\sqrt{n}\log n)$。#include#includeconst int N=50010,K=226;int n,m,l,r,i,j,k,size,block,a[N],b[N],p... 阅读全文
posted @ 2014-11-14 15:36 Claris 阅读(296) 评论(0) 推荐(0) 编辑