Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <iostream>#include <queue>#include <string.h>using namespace std;const int maxN = 501;static int edge[maxN][maxN];bool visited[maxN];int father[maxN];int N, M; //边数,顶点数int ans; //结果void Ford_Fulkerson(){while (1){//一次大循环,找到一条可能的增广路径queue <int> q;memset(visited, 0, sizeof(visited));memset(father, -1, sizeof(father));int now;visited[0] = true;q.push(0);while (!q.empty())//广度优先{now = q.front();q.pop();if (now == M - 1) break;for (int i = 0; i < M; i++){