数列分块入门 1

https://loj.ac/problem/6277

区间加 + 单点查询

#include <iostream>
#include <cstdio>
#include <cmath> using namespace std;
const int N = 5e4 + ; #define gc getchar() inline int read() {
int x = ; char c = gc;
while(c < '' || c > '') c = gc;
while(c >= '' && c <= '') x = x * + c - '', c = gc;
return x;
} int A[N], Add[N], bel[N];
int n, block, cnt; void Sec_G(int x, int y, int w) {
if(bel[x] == bel[y]) for(int i = x; i <= y; i ++) A[i] += w;
else {
for(int i = x; i <= bel[x] * block; i ++) A[i] += w;
for(int i = (bel[y] - ) * block + ; i <= y; i ++) A[i] += w;
}
for(int i = bel[x] + ; i < bel[y]; i ++) Add[i] += w;
} int main() {
n = read();
block = sqrt(n);
for(int i = ; i <= n; i ++) A[i] = read();
for(int i = ; i <= n; i ++) bel[i] = (i - ) / block + ;
if(n % block) cnt = n / block + ;
else cnt = n / block;
int T = n;
while(T --) {
int opt = read(), l = read(), r = read(), c = read();
if(!opt) Sec_G(l, r, c);
else cout << A[r] + Add[bel[r]] << endl;
}
return ;
}

数列分块入门 2

https://loj.ac/problem/6278

区间加法,询问区间内小于某个值 x 的元素个数

用B[]记录A[], B[]数组中为排好序的A[]的映射

那么每次可以对每一块进行二分查找

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm> using namespace std;
const int N = 5e4 + ; #define gc getchar() inline int read() {
int x = ; char c = gc;
while(c < '' || c > '') c = gc;
while(c >= '' && c <= '') x = x * + c - '', c = gc;
return x;
} int A[N], B[N], Add[N], bel[N];
int n, block, cnt; void Work_sort(int x) {
int l = (x - ) * block + , r = min(l + block - , n);
for(int i = l; i <= r; i ++) B[i] = A[i];
sort(B + l, B + r + );
} void Sec_G(int x, int y, int w) {
if(bel[x] == bel[y]) {
for(int i = x; i <= y; i ++) A[i] += w;
Work_sort(bel[x]);
}
else {
for(int i = x; i <= bel[x] * block; i ++) A[i] += w; Work_sort(bel[x]);
for(int i = (bel[y] - ) * block + ; i <= y; i ++) A[i] += w; Work_sort(bel[y]);
}
for(int i = bel[x] + ; i < bel[y]; i ++) Add[i] += w;
} inline int Calc(int x, int w) {
int l = (x - ) * block + , r = min(l + block - , n), ret = ;
while(l <= r) {
int mid = (l + r) >> ;
if(B[mid] + Add[x] < w) ret = mid, l = mid + ;
else r = mid - ;
}
return ret ? (ret - (x - ) * block) : ;
} inline int Sec_A(int x, int y, int w) {
int ret();
if(bel[x] == bel[y]) {
for(int i = x; i <= y; i ++) if(A[i] + Add[bel[x]] < w) ret ++;
return ret;
} else {
for(int i = x; i <= bel[x] * block; i ++) if(A[i] + Add[bel[x]] < w) ret ++;
for(int i = (bel[y] - ) * block + ; i <= y; i ++)
if(A[i] + Add[bel[y]] < w)
ret ++;
}
for(int i = bel[x] + ; i < bel[y]; i ++)
ret += Calc(i, w);
return ret;
} int main() {
n = read();
block = sqrt(n);
for(int i = ; i <= n; i ++) A[i] = read();
for(int i = ; i <= n; i ++) bel[i] = (i - ) / block + ;
if(n % block) cnt = n / block + ;
else cnt = n / block;
for(int i = ; i <= cnt; i ++) Work_sort(i);
int T = n;
while(T --) {
int opt = read(), l = read(), r = read(), c = read();
if(!opt) Sec_G(l, r, c);
else cout << Sec_A(l, r, c * c) << "\n";
}
return ;
}

数列分块入门 3

https://loj.ac/problem/6279

区间加法,询问区间内小于某个值 x 的前驱

与2类似,二分查找

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm> using namespace std;
const int N = 1e5 + ;
const int oo = ; #define gc getchar() inline int read() {
int x = ; char c = gc;
while(c < '' || c > '') c = gc;
while(c >= '' && c <= '') x = x * + c - '', c = gc;
return x;
} int A[N], B[N] = {-}, Add[N], bel[N];
int n, block, cnt; void Work_sort(int x) {
int l = (x - ) * block + , r = min(l + block - , n);
for(int i = l; i <= r; i ++) B[i] = A[i];
sort(B + l, B + r + );
} void Sec_G(int x, int y, int w) {
if(bel[x] == bel[y]) {
for(int i = x; i <= y; i ++) A[i] += w;
Work_sort(bel[x]);
}
else {
for(int i = x; i <= bel[x] * block; i ++) A[i] += w; Work_sort(bel[x]);
for(int i = (bel[y] - ) * block + ; i <= y; i ++) A[i] += w; Work_sort(bel[y]);
}
for(int i = bel[x] + ; i < bel[y]; i ++) Add[i] += w;
} inline int Calc(int x, int w) {
int l = (x - ) * block + , r = min(l + block - , n), ret = ;
while(l <= r) {
int mid = (l + r) >> ;
if(B[mid] + Add[x] < w) ret = mid, l = mid + ;
else r = mid - ;
}
return B[ret] + Add[x];
} inline int Sec_A(int x, int y, int w) {
int ret = -;
if(bel[x] == bel[y]) {
for(int i = x; i <= y; i ++) if(A[i] + Add[bel[x]] < w && A[i] + Add[bel[x]] > ret) ret = A[i] + Add[bel[x]];
return ret;
} else {
for(int i = x; i <= bel[x] * block; i ++)
if(A[i] + Add[bel[x]] < w && A[i] + Add[bel[x]] > ret) ret = A[i] + Add[bel[x]];
for(int i = (bel[y] - ) * block + ; i <= y; i ++)
if(A[i] + Add[bel[y]] < w && A[i] + Add[bel[y]] > ret) ret = A[i] + Add[bel[y]];
}
for(int i = bel[x] + ; i < bel[y]; i ++) {
int imp = Calc(i, w);
if(imp < w && imp > ret) ret = imp;
}
return ret;
} int main() {
n = read();
block = sqrt(n);
for(int i = ; i <= n; i ++) A[i] = read();
for(int i = ; i <= n; i ++) bel[i] = (i - ) / block + ;
if(n % block) cnt = n / block + ;
else cnt = n / block;
for(int i = ; i <= cnt; i ++) Work_sort(i);
int T = n;
while(T --) {
int opt = read(), l = read(), r = read(), c = read();
if(!opt) Sec_G(l, r, c);
else cout << Sec_A(l, r, c) << "\n";
}
return ;
}

数列分块入门 4

区间加法,区间求和

https://loj.ac/problem/6280

没什么好说的

#include <iostream>
#include <cstdio>
#include <cmath> using namespace std;
const int N = 5e4 + ; #define gc getchar() inline int read() {
int x = ; char c = gc;
while(c < '' || c > '') c = gc;
while(c >= '' && c <= '') x = x * + c - '', c = gc;
return x;
} #define LL long long LL A[N], Add[N], bel[N], W[N];
int n, block, cnt, Mod; void Sec_G(int x, int y, int w) {
if(bel[x] == bel[y]) for(int i = x; i <= y; i ++) A[i] += w, W[bel[x]] += w;
else {
for(int i = x; i <= bel[x] * block; i ++) A[i] += w, W[bel[x]] += w;
for(int i = (bel[y] - ) * block + ; i <= y; i ++) A[i] += w, W[bel[y]] += w;
}
for(int i = bel[x] + ; i < bel[y]; i ++) Add[i] += w, W[i] += w * block;
} inline int Sec_A(int x, int y) {
LL ret = ;
if(bel[x] == bel[y])
for(int i = x; i <= y; i ++)
ret += (A[i] + Add[bel[x]]) % Mod;
else {
for(int i = x; i <= bel[x] * block; i ++) ret += (A[i] + Add[bel[x]]) % Mod;
for(int i = (bel[y] - ) * block + ; i <= y; i ++) ret += (A[i] + Add[bel[y]]) % Mod;
}
for(int i = bel[x] + ; i < bel[y]; i ++) ret += W[i] % Mod;
return ret% Mod;
} int main() {
n = read();
block = sqrt(n);
for(int i = ; i <= n; i ++) A[i] = read();
for(int i = ; i <= n; i ++) bel[i] = (i - ) / block + , W[bel[i]] += A[i];
if(n % block) cnt = n / block + ;
else cnt = n / block;
int T = n;
while(T --) {
int opt = read(), l = read(), r = read(), c = read(); Mod = c + ;
if(!opt) Sec_G(l, r, c);
else cout << Sec_A(l, r) << endl;
}
return ;
}

数列分块入门 5

区间开方,区间求和

一个数(合理)开几次根后就是0/1了

因此,只需记录每块的最大值,如果最大值是0/1就没必要开根

#include <iostream>
#include <cstdio>
#include <cmath> using namespace std;
const int N = 5e4 + ; #define gc getchar() inline int read() {
int x = ; char c = gc;
while(c < '' || c > '') c = gc;
while(c >= '' && c <= '') x = x * + c - '', c = gc;
return x;
} #define LL long long LL A[N], Add[N], bel[N], W[N], Max[N];
int n, block, cnt, Mod; inline void Sec_G(int x, int y) {
if(bel[x] == bel[y]) {
if(!Max[bel[x]]) return ;
if(Max[bel[x]] == ) return ;
for(int i = x; i <= y; i ++) {
int C = A[i] - (int) sqrt(A[i]);
W[bel[x]] -= C; A[i] = (int) sqrt(A[i]);
}
LL Max_A = ;
for(int i = (bel[x] - ) * block + ; i <= bel[x] * block; i ++) Max_A = max(Max_A, A[i]);
Max[bel[x]] = Max_A;
return ;
}
else {
if(Max[bel[x]] && Max[bel[x]] != ) {
for(int i = x; i <= bel[x] * block; i ++) {
int C = A[i] - (int) sqrt(A[i]);
W[bel[x]] -= C;
A[i] = (int) sqrt(A[i]);
}
LL Max_A = ;
for(int i = (bel[x] - ) * block + ; i <= bel[x] * block; i ++) Max_A = max(Max_A, A[i]);
Max[bel[x]] = Max_A;
}
if(Max[bel[y]] && Max[bel[y]] != ) {
for(int i = (bel[y] - ) * block + ; i <= y; i ++) {
int C = A[i] - (int) sqrt(A[i]);
W[bel[y]] -= C;
A[i] = (int) sqrt(A[i]);
}
LL Max_A = ;
for(int i = (bel[y] - ) * block + ; i <= bel[y] * block; i ++) Max_A = max(Max_A, A[i]);
Max[bel[y]] = Max_A;
}
}
for(int i = bel[x] + ; i < bel[y]; i ++) {
if(!Max[i] || Max[i] == ) continue ;
LL Max_A = ;
for(int j = (i - ) * block + ; j <= i * block; j ++) {
int C = A[j] - (int) sqrt(A[j]);
W[i] -= C;
A[j] = (int) sqrt(A[j]);
Max_A = max(Max_A, A[j]);
}
Max[i] = Max_A;
}
} inline int Sec_A(int x, int y) {
LL ret = ;
if(bel[x] == bel[y] && Max[bel[x]]) for(int i = x; i <= y; i ++) ret += A[i];
else {
for(int i = x; i <= bel[x] * block && Max[bel[x]]; i ++) ret += A[i];
for(int i = (bel[y] - ) * block + ; i <= y && Max[bel[y]]; i ++) ret += A[i];
}
for(int i = bel[x] + ; i < bel[y]; i ++) ret += W[i];
return ret;
} int main() {
n = read();
block = sqrt(n);
for(int i = ; i <= n; i ++) A[i] = read();
for(int i = ; i <= n; i ++) bel[i] = (i - ) / block + , W[bel[i]] += A[i], Max[bel[i]] = max(Max[bel[i]], A[i]);
int T = n;
while(T --) {
int opt = read(), l = read(), r = read(), c = read();
if(!opt) Sec_G(l, r);
else cout << Sec_A(l, r) << "\n";
}
return ;
}

数列分块入门 6

https://loj.ac/problem/6282

单点插入,单点询问

数据随机,分块,对于每一块开动态数组,插入 + 查询比较容易实现

如果数据不随机,就有可能加到同一块中的数较多,影响效率

这样可以进行一定的插入操作之后重新分块

#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector> using namespace std;
const int N = 1e5 + ; int A[N << ], n;
vector <int> Vec[];
int block, bel[N]; #define gc getchar() inline int read() {
int x = ; char c = gc;
while(c < '' || c > '') c = gc;
while(c >= '' && c <= '') x = x * + c - '', c = gc;
return x;
} inline void Ins(int x, int a) {
int now_size(), Whi;
for(int i = ; ; i ++) {
int Size = Vec[i].size();
now_size += Size;
if(now_size >= x) {
Whi = i;
x -= (now_size - Size);
break;
}
}
Vec[Whi].insert(Vec[Whi].begin() + x - , a);
} inline int Poi_A(int x) {
int Whi_, now_size();
for(int i = ; ; i ++) {
int Size = Vec[i].size();
now_size += Size;
if(now_size >= x) {
int iii = x - (now_size - Size);
return Vec[i][iii - ];
}
}
} int main() {
n = read();
block = sqrt(n);
for(int i = ; i <= n; i ++) A[i] = read();
for(int i = ; i <= n; i ++) bel[i] = (i - ) / block + ;
for(int i = ; i <= n; i ++) Vec[bel[i]].push_back(A[i]);
int T = n; while(T --) {
int opt = read(), l = read(), r = read(), c = read();
if(!opt) Ins(l, r);
else cout << Poi_A(r) << endl;
}
return ;
}

数列分块入门 7

https://loj.ac/problem/6283

区间乘法,区间加法,单点询问

先乘后加,乘的时候相应的加法标记也要乘

#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector> using namespace std;
const int N = 1e5 + ;
const int Mod = 1e4 + ; #define LL long long LL A[N], Mul[N], Add[N], bel[N];
int n, cnt, block; #define gc getchar() inline int read() {
int x = , f = ; char c = gc;
while(c < '' || c > '') {if(c == '-') f = -; c = gc;}
while(c >= '' && c <= '') x = x * + c - '', c = gc;
return x;
} inline void Sec_Add(int x, int y, int w) {
if(bel[x] == bel[y]) {
for(int i = (bel[x] - ) * block + ; i <= bel[x] * block; i ++) A[i] = (A[i] * Mul[bel[x]] + Add[bel[x]]);
Add[bel[x]] = ; Mul[bel[x]] = ;
for(int i = x; i <= y; i ++) A[i] += w, A[i] %= Mod;
return ;
} else {
for(int i = (bel[x] - ) * block + ; i <= bel[x] * block; i ++) A[i] = (A[i] * Mul[bel[i]] + Add[bel[i]]) % Mod;
Add[bel[x]] = ; Mul[bel[x]] = ;
for(int i = x; i <= bel[x] * block; i ++) A[i] += w, A[i] %= Mod;
for(int i = (bel[y] - ) * block + ; i <= bel[y] * block; i ++) A[i] = (A[i] * Mul[bel[i]] + Add[bel[i]]) % Mod;
Add[bel[y]] = ; Mul[bel[y]] = ;
for(int i = (bel[y] - ) * block + ; i <= y; i ++) A[i] += w, A[i] %= Mod;
}
for(int i = bel[x] + ; i < bel[y]; i ++) Add[i] += w, Add[i] %= Mod;
} inline void Sec_Mul(int x, int y, int w) {
if(bel[x] == bel[y]) {
for(int i = (bel[x] - ) * block + ; i <= bel[x] * block; i ++) A[i] = (A[i] * Mul[bel[i]] + Add[bel[i]]) % Mod;
Add[bel[x]] = ; Mul[bel[x]] = ;
for(int i = x; i <= y; i ++) A[i] = (A[i] * w) % Mod;
return ;
} else {
for(int i = (bel[x] - ) * block + ; i <= bel[x] * block; i ++) A[i] = (A[i] * Mul[bel[i]] + Add[bel[i]]) % Mod;
Add[bel[x]] = ; Mul[bel[x]] = ;
for(int i = x; i <= bel[x] * block; i ++) A[i] = (A[i] * w) % Mod;
for(int i = (bel[y] - ) * block + ; i <= bel[y] * block; i ++) A[i] = (A[i] * Mul[bel[i]] + Add[bel[i]]) % Mod;
Add[bel[y]] = ; Mul[bel[y]] = ;
for(int i = (bel[y] - ) * block + ; i <= y; i ++) A[i] = (A[i] * w) % Mod;
}
for(int i = bel[x] + ; i < bel[y]; i ++) Add[i] = (Add[i] * w) % Mod, Mul[i] = (Mul[i] * w) % Mod;
} int main() {
n = read();
for(int i = ; i <= n; i ++) A[i] = read();
block = sqrt(n);
for(int i = ; i <= n; i ++) bel[i] = (i - ) / block + , Mul[i] = ;
int T = n;
while(T --) {
int opt = read(), l = read(), r = read(), c = read();
if(opt == ) Sec_Add(l, r, c);
else if(opt == ) Sec_Mul(l, r, c);
else cout << (A[r] * Mul[bel[r]] + Add[bel[r]]) % Mod << "\n";
}
return ;
}

数列分块入门 8

https://loj.ac/problem/6284

暴力

区间修改没有什么难度,这题难在区间查询比较奇怪,因为权值种类比较多,似乎没有什么好的维护方法。

模拟一些数据可以发现,询问后一整段都会被修改,几次询问后数列可能只剩下几段不同的区间了。

我们思考这样一个暴力,还是分块,维护每个分块是否只有一种权值,区间操作的时候,对于同权值的一个块就O(1)统计答案,否则暴力统计答案,并修改标记,不完整的块也暴力。

这样看似最差情况每次都会耗费O(n)的时间,但其实可以这样分析:

假设初始序列都是同一个值,那么查询是O(√n),如果这时进行一个区间操作,它最多破坏首尾2个块的标记,所以只能使后面的询问至多多2个块的暴力时间,所以均摊每次操作复杂度还是O(√n)。

换句话说,要想让一个操作耗费O(n)的时间,要先花费√n个操作对数列进行修改。

初始序列不同值,经过类似分析后,就可以放心的暴力啦。

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring> using namespace std;
const int N = 1e5 + ; int bel[N], A[N], bec[N];
int n;
int block; #define gc getchar() inline int read() {
int x = ; char c = gc;
while(c < '' || c > '') c = gc;
while(c >= '' && c <= '') x = x * + c - '', c = gc;
return x;
} int Sec_A(int x, int y, int c) {
int ret();
if(bel[x] == bel[y]) {
if(bec[bel[x]] == c) ret = y - x + ;
else if(bec[bel[x]] == -) for(int i = x; i <= y; i ++) if(A[i] == c) ret ++;
if(~ bec[bel[x]]) for(int i = (bel[x] - ) * block + ; i < x; i ++) A[i] = bec[bel[x]];
if(~ bec[bel[x]]) for(int i = y + ; i <= bel[x] * block; i ++) A[i] = bec[bel[x]];
for(int i = x; i <= y; i ++) A[i] = c;
bec[bel[x]] = -;
} else {
if(bec[bel[x]] == c) ret += bel[x] * block - x + ;
else if(bec[bel[x]] == -) for(int i = x; i <= bel[x] * block; i ++) if(A[i] == c) ret ++;
if(bec[bel[y]] == c) ret += y - ((bel[y] - ) * block);
else if(bec[bel[y]] == -) for(int i = (bel[y] - ) * block + ; i <= y; i ++) if(A[i] == c) ret ++;
for(int i = bel[x] + ; i < bel[y]; i ++) {
if(bec[i] == c) ret += block;
else if(bec[i] == -)
for(int j = (i - ) * block + ; j <= i * block; j ++)
if(A[j] == c) ret ++;
}
if(~ bec[bel[x]]) for(int i = (bel[x] - ) * block + ; i < x; i ++) A[i] = bec[bel[i]];
for(int i = x; i <= bel[x] * block; i ++) A[i] = c;
bec[bel[x]] = -;
for(int i = (bel[y] - ) * block + ; i <= y; i ++) A[i] = c;
if(~ bec[bel[y]]) for(int i = y + ; i <= bel[y] * block; i ++) A[i] = bec[bel[i]];
bec[bel[y]] = -;
for(int i = bel[x] + ; i < bel[y]; i ++) bec[i] = c;
}
return ret;
} int main() {
n = read();
for(int i = ; i <= n; i ++) bec[i] = -;
for(int i = ; i <= n; i ++) A[i] = read();
block = sqrt(n);
for(int i = ; i <= n; i ++) bel[i] = (i - ) / block + ;
int T = n;
while(T --) {
int l = read(), r = read(), c = read();
cout << Sec_A(l, r, c) << "\n";
}
return ;
}

数列分块入门 9

https://loj.ac/problem/6285

区间众数查询

陈立杰区间众数解题报告

#include<map>
#include<set>
#include<cmath>
#include<stack>
#include<queue>
#include<cstdio>
#include<vector>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define mod 10007
#define pi acos(-1)
#define inf 0x7fffffff
#define ll long long
using namespace std;
ll read() {
ll x=,f=;
char ch=getchar();
while(ch<''||ch>'') {
if(ch=='-')f=-;
ch=getchar();
}
while(ch>=''&&ch<='') {
x=x*+ch-'';
ch=getchar();
}
return x*f;
}
int n,blo,id;
int v[],bl[];
int f[][];
map<int,int>mp;
int val[],cnt[];
vector<int>ve[];
void pre(int x) {
memset(cnt,,sizeof(cnt));
int mx=,ans=;
for(int i=(x-)*blo+; i<=n; i++) {
cnt[v[i]]++;
int t=bl[i];
if(cnt[v[i]]>mx||(cnt[v[i]]==mx&&val[v[i]]<val[ans]))
ans=v[i],mx=cnt[v[i]];
f[x][t]=ans;
}
}
int query(int l,int r,int x) {
int t=upper_bound(ve[x].begin(),ve[x].end(),r)-lower_bound(ve[x].begin(),ve[x].end(),l);
return t;
}
int query(int a,int b) {
int ans,mx;
ans=f[bl[a]+][bl[b]-];
mx=query(a,b,ans);
for(int i=a; i<=min(bl[a]*blo,b); i++) {
int t=query(a,b,v[i]);
if(t>mx||(t==mx&&val[v[i]]<val[ans]))ans=v[i],mx=t;
}
if(bl[a]!=bl[b])
for(int i=(bl[b]-)*blo+; i<=b; i++) {
int t=query(a,b,v[i]);
if(t>mx||(t==mx&&val[v[i]]<val[ans]))ans=v[i],mx=t;
}
return ans;
}
int main() {
n=read();
blo=;
for(int i=; i<=n; i++) {
v[i]=read();
if(!mp[v[i]]) {
mp[v[i]]=++id;
val[id]=v[i];
}
v[i]=mp[v[i]];
ve[v[i]].push_back(i);
}
for(int i=; i<=n; i++)bl[i]=(i-)/blo+;
for(int i=; i<=bl[n]; i++)pre(i);
for(int i=; i<=n; i++) {
int a=read(),b=read();
if(a>b)swap(a,b);
printf("%d\n",val[query(a,b)]);
}
return ;
}

分块算法小结:

  暴力算法

  时间复杂度可以

  空间允许

  优美

[Loj] 数列分块入门 1 - 9的更多相关文章

  1. loj 数列分块入门 6 9(区间众数)

    6 题意 给出一个长为\(n\)的数列,以及\(n\)个操作,操作涉及单点插入,单点询问,数据随机生成. 题解 参考:http://hzwer.com/8053.html 每个块内用一个\(vecto ...

  2. loj 数列分块入门 5 7 8

    5 题意 给出一个长为\(n\)的数列,以及\(n\)个操作,操作涉及区间开方,区间求和. 思路 用\(tag\)记录这一块是否已全为\(1\). 除分块外,还可用 树状数组+并查集(链表) 或者 线 ...

  3. LOJ 数列分块入门系列

    目录 1.区间加+单点查 每个块维护tag,散的暴力改. code: #include<bits/stdc++.h> using namespace std; const int maxn ...

  4. LOJ 6277:数列分块入门 1(分块入门)

    #6277. 数列分块入门 1 内存限制:256 MiB时间限制:100 ms标准输入输出 题目类型:传统评测方式:文本比较 上传者: hzwer 提交提交记录统计讨论 3 测试数据 题目描述 给出一 ...

  5. LOJ #6285. 数列分块入门 9-分块(查询区间的最小众数)

    #6285. 数列分块入门 9 内存限制:256 MiB时间限制:1500 ms标准输入输出 题目类型:传统评测方式:文本比较 上传者: hzwer 提交提交记录统计测试数据讨论 2   题目描述 给 ...

  6. LOJ #6284. 数列分块入门 8-分块(区间查询等于一个数c的元素,并将这个区间的所有元素改为c)

    #6284. 数列分块入门 8 内存限制:256 MiB时间限制:500 ms标准输入输出 题目类型:传统评测方式:文本比较 上传者: hzwer 提交提交记录统计测试数据讨论 2   题目描述 给出 ...

  7. LOJ #6283. 数列分块入门 7-分块(区间乘法、区间加法、单点查询)

    #6283. 数列分块入门 7 内存限制:256 MiB时间限制:500 ms标准输入输出 题目类型:传统评测方式:文本比较 上传者: hzwer 提交提交记录统计测试数据讨论 2   题目描述 给出 ...

  8. LOJ #6282. 数列分块入门 6-分块(单点插入、单点查询、数据随机生成)

    #6282. 数列分块入门 6 内存限制:256 MiB时间限制:500 ms标准输入输出 题目类型:传统评测方式:文本比较 上传者: hzwer 提交提交记录统计测试数据讨论 1   题目描述 给出 ...

  9. LOJ #6281. 数列分块入门 5-分块(区间开方、区间求和)

    #6281. 数列分块入门 5 内存限制:256 MiB时间限制:500 ms标准输入输出 题目类型:传统评测方式:文本比较 上传者: hzwer 提交提交记录统计测试数据讨论 5   题目描述 给出 ...

随机推荐

  1. 数据结构C++实现-第一章 绪论

    1.1 计算机与算法 1.1.3 起泡排序 void bubbleSort(int a[], int n) { for(bool sorted=false; !sorted; --n) { sorte ...

  2. python学习-9 pycharm的安装

    1.python 开发IDE :  pycharm.eclipse等等 安装: 百度搜索pycharm 就可以了,去官网下载专业版.(百度有各种破解方法)                    #不要 ...

  3. Delphi cxpagecontrol融合窗体

    功能说明: 一.在需要融合的每个窗体加一句 initialization RegisterClasses([TFrmDataDict]); //类名 二.cxpagecontrol融合窗体,在调用时 ...

  4. python入门pk小游戏

    import time import random flag = True while flag: player_win = 0 enemy_win = 0 for i in range(1, 4): ...

  5. Web API 自动生成接口文档

    1.添加NuGet程序包 Microsoft ASP.NET Web API 2.2 Help Page      (这是微软官方的) A Simple Test Client for ASP.NET ...

  6. gitlab 搭建

     一.ubuntu搭建gitlab     1. 如果以前有安装过gitlab请根据以下步骤来删除 https://www.cnblogs.com/shansongxian/p/6678110.htm ...

  7. queryURLParams

    let url = 'http://www.douqu.com/index.html?name1=val1&name2=val2'; //1.提取问号后的字符 let asktext = ur ...

  8. Navicat for MySQL 设置定时任务(事件)

    1.查询界面输入命令,查看定时任务是否开启,未开始时OFF: show variables like '%event_scheduler%'; 2. 查询界面输入命令,开启定时任务: set glob ...

  9. Spring Boot启动流程分析

    引言 早在15年的时候就开始用spring boot进行开发了,然而一直就只是用用,并没有深入去了解spring boot是以什么原理怎样工作的,说来也惭愧.今天让我们从spring boot启动开始 ...

  10. “最不合格”的SAP应聘者: 从大学生到SAP成都研究院开发工程师

    让我们把时光之轮倒拨回2006年,SAP成都研究院刚刚成立的时候,有一位年轻的电子科技大学研究生,网名雷米兰(这名字一看就是AC米兰铁杆粉丝),加入了SAP成都研究院并被派遣到SAP德国总部进行实习. ...