
莫队
syyyyyw
acmer一枚
展开
-
BZOJ 2038
不带修改的莫队 最简单的那种 n*n是可以取自己的 n*(n-1)是不取自己的 先处理n*n 最后减去n-1 要注意中间相乘 代码如下 #include<stdio.h> #include<algorithm> #include<string.h> #include<iostream> using namespace std; #de...原创 2018-08-03 22:51:54 · 194 阅读 · 0 评论 -
BZOJ 1878
求区间有多少不同的数 可以莫队,离线树状数组,主席树做 先写一个莫队的做法 代码如下: #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<cmath> using namespace std; int n,m,l,...原创 2018-08-05 10:31:57 · 219 阅读 · 0 评论 -
hdu 6333 多校第4场B
代码如下 #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<cmath> using namespace std; typedef long long ll; const int maxn=100005; ll f[...原创 2018-08-06 14:31:10 · 218 阅读 · 0 评论