上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页
摘要: 【数学】 收录一些用 数学处理手法/纯数学计算推规律 的题目 最小值 https://acm.hdu.edu.cn/contest/problem?cid=1176&pid=1012 题目大意 思路 【看到绝对值】第一个想法是去绝对值->分类讨论 【找序列两数相减绝对值最小】排序,求差分,差分序列最 阅读全文
posted @ 2025-01-17 23:39 White_ink 阅读(42) 评论(0) 推荐(0)
摘要: 【树状数组】 模版代码 struct FenwickTree { vector<int> tree; int size; FenwickTree(int n){ size=n; tree.resize(n+1,0); } void update(int pos, int delta){ for(;p 阅读全文
posted @ 2025-01-17 17:30 White_ink 阅读(41) 评论(0) 推荐(0)
摘要: 【算法竞赛】一些好用的模版/注意要点 火车头(2026.07.06更新) #include<bits/stdc++.h> using namespace std; #define endl '\n' #define whiteink signed main #define fi first #def 阅读全文
posted @ 2025-01-12 15:56 White_ink 阅读(73) 评论(0) 推荐(0)
摘要: 【Kruskal算法】 模版题 https://www.acwing.com/file_system/file/content/whole/index/content/4386/ 思路 (1)将所有边按权重从小到大排序 (2)枚举每条边a-b 权重为c if(a,b不连通) //并查集思想 将这条边 阅读全文
posted @ 2025-01-12 13:34 White_ink 阅读(26) 评论(0) 推荐(0)
摘要: 【Prim】 模版题 https://www.acwing.com/file_system/file/content/whole/index/content/4385/ 思路 (1)朴素版Prim: dist[i] <- 正无穷 for(i=0;i<n;i++){ t<-找到集合外距离最近的点 用t 阅读全文
posted @ 2025-01-12 13:01 White_ink 阅读(43) 评论(0) 推荐(0)
摘要: ![image](https://img2024.cnblogs.com/blog/3544683/202501/3544683-20250112100010833-681473226.png) 阅读全文
posted @ 2025-01-12 10:00 White_ink 阅读(15) 评论(0) 推荐(1)
摘要: ![image](https://img2024.cnblogs.com/blog/3544683/202501/3544683-20250112101639181-1641857163.png) ![image](https://img2024.cnblogs.com/blog/3544683/202501/3544683-20250112095729398-2025768444.png) 阅读全文
posted @ 2025-01-12 09:58 White_ink 阅读(30) 评论(0) 推荐(0)
摘要: 【二分查找】 二分模版 如果二分出来有问题,一定不会是模版的问题! /* 若R=mid L=mid+1->找满足条件更小的->(L+R)>>1 若L=mid R=mid-1->找满足条件更大的->(L+R+1)>>1 答案就是L/R */ int L=0,R=INF; while(L<R){ int 阅读全文
posted @ 2025-01-11 14:56 White_ink 阅读(44) 评论(0) 推荐(0)
摘要: 不同节点之间话题订阅发布 https://www.cnblogs.com/whiteink/articles/18595916 要点 (1)消息接口包:写+包含 (2)publisher和subscription:定义、调用+回调函数写实际操作! (3)launch一次启动多节点 (4)没收到消息的 阅读全文
posted @ 2025-01-10 15:04 White_ink 阅读(79) 评论(0) 推荐(0)
摘要: 【Floyd】 ※用于处理多源汇最短路 时间复杂度:\(O(n^3)\) 思路 邻接矩阵存图/区间DP思想 d[i][j]表示从i到j的最短路 for(k=1;k<=n;k++) for(i=1;i<=n;i++) for(j=1;j<=n;j++) d[i][j]=min(d[i][j],d[i] 阅读全文
posted @ 2025-01-10 13:11 White_ink 阅读(36) 评论(0) 推荐(0)
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页