摘要: 网络最大流 "P3376 【模板】网络最大流" 一、$Edmonds Karp$算法 不断在残量网络$dfs$进行增广,当不能进行增广时,即为最大流。 code: 最小费用最大流 "P3381 【模板】最小费用最大流" 最小费用流 将$bfs$改为$spfa$跑最小费用即可。 code: cpp i 阅读全文
posted @ 2019-09-18 21:46 Paranoid丶离殇 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 矩阵乘法基础模板: "P3390 【模板】矩阵快速幂" 在矩阵快速幂中,正对角线为$1$,其他为$0$的矩阵为单位矩阵。 利用单位矩阵进行快速幂。 code: cpp include include include using namespace std; typedef long long LL; 阅读全文
posted @ 2019-09-18 21:22 Paranoid丶离殇 阅读(325) 评论(1) 推荐(0) 编辑