![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
莫队
AKone123456
这个作者很懒,什么都没留下…
展开
-
带修莫队板子
//一定要记录每次询问前修改了几次 #include<bits/stdc++.h> using namespace std; const int N=1e6; int a[N],cnt[N],ans[N],tot,res,m,n,bl[N],bll,cnum; char op; struct query { int l,r,id,pre;//最近修改的位置 }e[N]; struct ...原创 2019-11-09 16:27:47 · 111 阅读 · 0 评论 -
I - D-query SPOJ - DQUERY
Given a sequence of n numbers a1, a2, …, an and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, j), you have to return the number of distinct elements in the su...原创 2019-11-08 20:23:07 · 96 阅读 · 0 评论