[置顶] CF 86D Powerful array 分块算法入门,n*sqrt(n)
摘要:
简介:分块算法主要是把区间划分成sqrt(n)块,从而降低暴力的复杂度, 其实这算是一种优化的暴力吧,复杂度O(n*sqrt(n)) 题意:给定一个数列:a[i] (1#include #include #include #include using namespace std;const int maxn = 200005;typedef long long LL;LL a[maxn], cnt[maxn * 5], ans[maxn], res;int L, R;struct node { int l, r, b, id; bool operator <(const node ... 阅读全文
浙公网安备 33010602011771号