P3376 网络最大流
裸题模板:
/*---------------------------------
*File name: Dinic.cpp
*Creation date: 2020-05-19 10:32
*-------------------------------*/
#include<set>
#include<map>
#include<cmath>
#include<queue>
#include<vector>
#include<cstdio>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
#define fi first
#define se second
#define pb push_back
#define LL long long
#define PII pair<int, int>
#define Pque priority_queue
#define loop(c, a, b) for(int c = a; c <= b; ++c)
using namespace std;
const int maxn = 1e5 + 5;
const int inf = 0x3f3f3f3f;
const LL mod = 1e9 + 7;
struct Edge{
int to;
int next;
int w;
}edge[maxn * 2];
int head[maxn];
int cur[maxn];//当前弧优化数组
int n, m, s, t;
int dis[maxn];//Bfs深度
int cnt = 0;//边