摘要: 树状数组 P3374 【模板】树状数组 1——树状数组区间和 #include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0);cout.tie(0);cin.tie(0); #define endl ' 阅读全文
posted @ 2025-11-26 13:56 10mbps_十兆網路 阅读(1) 评论(0) 推荐(0)
摘要: 次短路 & dijkstra——P2865 [USACO06NOV] Roadblocks G #include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0);cout.tie(0);cin.tie(0 阅读全文
posted @ 2025-11-26 13:55 10mbps_十兆網路 阅读(1) 评论(0) 推荐(0)
摘要: P3366 【模板】最小生成树 Prim #include<bits/stdc++.h> using namespace std; #define int long long #define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #d 阅读全文
posted @ 2025-11-26 13:55 10mbps_十兆網路 阅读(0) 评论(0) 推荐(0)
摘要: P3805 【模板】Manacher #include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0);cout.tie(0);cin.tie(0); #define endl '\n' #define 阅读全文
posted @ 2025-11-26 13:55 10mbps_十兆網路 阅读(0) 评论(0) 推荐(0)
摘要: B3644 【模板】拓扑排序 / 家谱树 #include<iostream> #include<string> #include<algorithm> #include<stack> using namespace std; int w[101][101]; int in[101],s[101]; 阅读全文
posted @ 2025-11-26 13:54 10mbps_十兆網路 阅读(1) 评论(0) 推荐(0)
摘要: Tarjan——强连通分量 B3609 [图论与代数结构 701] 强连通分量 #include<bits/stdc++.h> using namespace std; //#define int long long #define IOS ios::sync_with_stdio(0);cin.t 阅读全文
posted @ 2025-11-26 13:54 10mbps_十兆網路 阅读(0) 评论(0) 推荐(0)
摘要: 二分 // 查找第一个满足条件的元素 int l = 1, r = n; while (l < r) { int mid = l + ((r - l) >> 1); // 防溢出,等价于 (l + r) / 2 if (check(mid)) { r = mid; // 满足条件,往左找更小的 } 阅读全文
posted @ 2025-11-26 13:54 10mbps_十兆網路 阅读(0) 评论(0) 推荐(0)
摘要: Floyd #include<iostream> #include<cstring> #include<cmath> using namespace std; int dis[101][101]; int main(){ int n,m; cin>>n>>m; memset(dis,0x7f,siz 阅读全文
posted @ 2025-11-26 13:53 10mbps_十兆網路 阅读(0) 评论(0) 推荐(0)
摘要: 并查集 #include<bits/stdc++.h> using namespace std; #define int long long #define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define endl '\n' c 阅读全文
posted @ 2025-11-26 13:53 10mbps_十兆網路 阅读(0) 评论(0) 推荐(0)
摘要: KMP——求border数组&字符串匹配 拼接字符串法 #include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0);cout.tie(0);cin.tie(0); #define endl '\n' 阅读全文
posted @ 2025-11-26 13:53 10mbps_十兆網路 阅读(0) 评论(0) 推荐(0)