1 #include2 #include 3 #include 4 #include 5 #define inf 0x3f3f3f3f 6 using namespace std; 7 int flow[20][20],cap[20][20],a[20],p[20],n; 8 int ek() 9 {10 queue q;11 while (!q.empty()) q.pop();12 memset(flow,0,sizeof(flow));13 int f=0,s=1,t=n;14 while (1)15 {16 memset(a,0,sizeof(a));17 a[s]=inf; q.push(s);18 while (!q.empty())19 {20 int u=q.front(); q.pop();21 for (int v=1;v<=n;v++)22 if (!a[v]&&cap[u][v]>flow[u][v])23 {24 p[v]=u; q.push(v);25 if (a[u]