codlz
codlz
全部文章
未归档
不抄模板能解题?(12)
后端开发实践(2)
题解(1)
归档
标签
去牛客网
登录
/
注册
这都不会?
全部文章
/ 未归档
(共51篇)
kmp模式匹配模板
kmp算法的关键就是前缀和后缀 #include<cstdio> #include<algorithm> #include<cstring> #include<iostream> using namespace std; const int MA...
2021-05-06
0
276
洛谷线段树2
第一行包含三个整数 n,m,pn,m,pn,m,p,分别表示该数列数字的个数、操作的总个数和模数。 第二行包含 nnn 个用空格分隔的整数,其中第 iii 个数字表示数列第 iii 项的初始值。 接下来 mmm 行每行包含若干个整数,表示一个操作,具体如下: 操作 111: 格式:1 x y k 含...
2021-05-06
0
308
状态压缩BFS
魔板,状态压缩BFS #include<iostream> #include<algorithm> #include<cstdio> #include<unordered_map> #include<queue> #include&l...
2021-05-06
0
365
电路维修 Acwing 双端BFS,相比单端可以有效减少开销
https://www.acwing.com/problem/content/177/ 双端队列BFS #include <bits/stdc++.h> #define x first #define y second using namespace std; const int N...
2021-05-06
0
356
AcWing 190 字串变换 双向BFS
#include <bits/stdc++.h> using namespace std; const int N = 100; string A[N], B[N]; //储存变换方式 int cnt; string st, ed; int extend_a(queue<stri...
2021-05-06
0
320
差分模板 区间加减
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int nums[N]; int dif[N]; int main() { #ifndef ONLINE_JUDGE freop...
2021-05-06
0
300
PTA树的同构 DFS道路选择
#include <bits/stdc++.h> using namespace std; struct Node { char data; int l, r; }lt[105], rt[105]; //记录左树和右树 int _list[105] = { ...
2021-05-06
0
372
区间和 离散化模板
ACWING 802 区间和 #include <bits/stdc++.h> using namespace std; const int N = 300010; using PII = pair<int, int>; int a[N]; //离散化后坐...
2021-05-06
0
285
单调栈 模板
给定一个长度为N的整数数列,输出每个数左边第一个比它小的数,如果不存在则输出-1。 #include <bits/stdc++.h> using namespace std; stack<int> stk; int main() { #ifndef ONLI...
2021-05-06
0
367
并查集 路径压缩 模板
ACWING 837. 连通块中点的数量 #include <bits/stdc++.h> using namespace std; const int N = 100005; int p[N], siz[N]; //只有根节点的size是有意义的 inline int fi...
2021-05-06
0
318
首页
上一页
1
2
3
4
5
6
下一页
末页