• 2024-09-02Dinic/ISAP求最大流
    算法执行过程见蓝书和OI-wiki,当前弧优化见OI-wiki的描述,代码见下#include<bits/stdc++.h>#definelllonglongusingnamespacestd;constintN=10010,M=100010,inf=1<<29;intnow[N],End[M<<1],Next[M<<1],Len[M<<1],Last[N];intn,m,s,t,cnt=1,d[N];llmax
  • 2024-03-02HLPP 预流推进
    Decribe:给定\(n\)个点\(m\)条边,每条边有一个流量\(f\)。给定起点\(s\)和终点\(t\),求最大流。(\(n\le1200,m\le120000\))Solution:当\(n,m\)来到这样一个上界,Dinic稍稍被卡就过不去了,与其研究奇奇怪怪的Dinic优化,真不如学一个HLPP,它又不难。(又不会吃掉你)学
  • 2023-02-150215
    今天做了昨天的T3以及去年省选的两个T3。[模拟赛20230214]两岸的猿第二次遇到这种题了。首先n^2dp是好做的,但是显然不能通过此题。然后我们可以把dp的转移看成边,然
  • 2022-12-13ISAP
    2171.EK求最大流#include<bits/stdc++.h>usingnamespacestd;constintN=1e4+5;constintM=1e6+5;inth[N],ne[M],e[M],w[M],tot=1;voidadd(intfrom,intto,
  • 2022-11-272173. Dinic/ISAP求最小割
    题目链接2173.Dinic/ISAP求最小割给定一个包含\(n\)个点\(m\)条边的有向图,并给定每条边的容量,边的容量非负。图中可能存在重边和自环。求从点\(S\)到点\(T\)的