随笔分类 -  数列分块+莫队

摘要:题目: https://www.luogu.com.cn/problem/P4462 利用的异或的前缀和性质, 有多少个区间[l,r]满足异或起来为k异或满足前缀和 有多少个sumr^sum(l-1) =k sum(l-1) =k^sumr 要将l换成l-1 #include<bits/stdc++ 阅读全文
posted @ 2021-08-12 10:15 废柴废柴少女 阅读(43) 评论(0) 推荐(0)
摘要:题目: https://www.luogu.com.cn/problem/P3901 #include<bits/stdc++.h> #include<stdio.h> using namespace std; const int maxn=1e5+7; int n,m,block,belong[m 阅读全文
posted @ 2021-08-12 09:40 废柴废柴少女 阅读(44) 评论(0) 推荐(0)
摘要:题目: https://www.luogu.com.cn/problem/P1494 维护总方案数,和每多一双袜子和没少一双袜子带来的贡献 #include<bits/stdc++.h> #include<stdio.h> using namespace std; const int maxn=5e 阅读全文
posted @ 2021-08-11 20:57 废柴废柴少女 阅读(22) 评论(0) 推荐(0)
摘要:题目: https://www.luogu.com.cn/problem/P2709 大意:求出从[1,k]再给出的区间[l,r]中出现的次数的平方和 因为数列是计数是从1开始的,所以要把L置为1,不然会把a[0]自动算上 #include<bits/stdc++.h> #include<stdio 阅读全文
posted @ 2021-08-11 20:34 废柴废柴少女 阅读(66) 评论(0) 推荐(0)