
莫队
混子本混
这个作者很懒,什么都没留下…
展开
-
B. Little Elephant and Array
B. Little Elephant and Array (莫队板子) 题意:在区间[l, r] 中有多少个数x ,其出现次数也为x 链接 #include <bits/stdc++.h> using namespace std; const int N = 1e5+10 ; int a[N] , cnt[N]; int ans[N]; int n , q ; int res = 0 ; struct node { int id , l , r ; }all[N] ; int len原创 2022-03-07 21:24:57 · 208 阅读 · 0 评论 -
G - Range Pairing Query
G - Range Pairing Query (莫队板子) 题意:每次询问求出[l, r]这个区间内最多可以组成多少对颜色相同的人 #include <bits/stdc++.h> using namespace std; const int N = 1e6+10 ; int a[N] , cnt[N] , res ,len ,ans[N]; int n , q ; template<typename T>inline void read(T &a) { char c原创 2022-03-07 21:21:22 · 194 阅读 · 0 评论