摘要: #include <bits/stdc++.h> using namespace std; const int MAXN = 1e7 + 10; const double Pi = acos(-1.0); struct Complex { double x, y; Complex (double x 阅读全文
posted @ 2026-01-07 15:03 wtnbl 阅读(2) 评论(0) 推荐(0)
摘要: ![IMG_1202](https://img2024.cnblogs.com/blog/3694705/202512/3694705-20251227142042488-61201624.jpg) 阅读全文
posted @ 2025-12-27 14:20 wtnbl 阅读(4) 评论(0) 推荐(0)
摘要: int add(int a, int b){return a + b < mod ? a + b : a + b - mod;} int mpow(int a, int b) { int c = 1; for(;b;b>>=1, a = mul(a, a)){ if(b & 1) c = mul(a 阅读全文
posted @ 2025-12-26 21:22 wtnbl 阅读(5) 评论(0) 推荐(0)
摘要: 莫队模板题 相当于优化的暴力,每一次调整左右节点的位置 #include <bits/stdc++.h> using namespace std; int n,m,k; const int N=5e4+5; int a[N]; int cnt[N];//用于计算当前区间i出现了几次 int ans[ 阅读全文
posted @ 2025-11-22 16:54 wtnbl 阅读(4) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; const int N=2e5+5; int n,cnt=0,didx=0,idx[N],ans[N]; string s[N]; struct Node { int son[26],idx,fail,ans 阅读全文
posted @ 2025-11-13 21:33 wtnbl 阅读(5) 评论(0) 推荐(0)
摘要: Dijkstra #include <bits/stdc++.h> #define pii pair<int,int> using namespace std; const int N=1e5+5; vector<vector<pair<int,int>>> G; int n,m,s; priori 阅读全文
posted @ 2025-11-01 10:53 wtnbl 阅读(4) 评论(0) 推荐(0)
摘要: 见pdf https://wwak.lanzouo.com/ipQq6398irbc 阅读全文
posted @ 2025-10-24 21:22 wtnbl 阅读(5) 评论(0) 推荐(0)
摘要: int findMinValid(int left, int right) { int ans = -1; while (left <= right) { int mid = (left+right)/2; if (check(mid)) { // 满足条件,尝试找更小的解 ans = mid; / 阅读全文
posted @ 2025-10-03 20:58 wtnbl 阅读(5) 评论(0) 推荐(0)
摘要: 少使用rbegin,用prev(end()) 尽量使用容器自带的函数,比如set的lower_bound() 阅读全文
posted @ 2025-09-24 15:01 wtnbl 阅读(6) 评论(0) 推荐(0)
摘要: 可以用一个map数组记录边存了没有 最简单好写的 数据范围\(m<=5e4\) map<pair<int,int>,bool> uni; for(int u,v,i=1;i<=m;i++) { cin>>u>>v; if(uni[{u,v}]) continue; uni[{u,v}]=uni[{v 阅读全文
posted @ 2025-08-28 10:10 wtnbl 阅读(8) 评论(0) 推荐(0)