# 【bzoj1433】【ZJOI2009】假期的宿舍

1
3
1 1 0
0 1 0
0 1 1
1 0 0
1 0 0

^_^

#include<bits/stdc++.h>
using namespace std;
#define ll long long

const int maxn=50*2+50;
const int maxm=10000*2+50;

int T,n,s=0,t=101,tot,d[maxn],x,maxflow;
int fir[maxn],nex[maxm],to[maxm],wi[maxm],ecnt;
bool in[maxn],go[maxn],know[maxn][maxn];

void add(int u,int v,int w){
nex[ecnt]=fir[u];fir[u]=ecnt;to[ecnt]=v;wi[ecnt++]=w;
}

queue<int> q;

int bfs(){
memset(d,0,sizeof(d));
d[s]=1;
q.push(s);
while(!q.empty()){
int u=q.front();q.pop();
for(int e=fir[u];~e;e=nex[e]){
int v=to[e];
if(wi[e]&&!d[v]){
d[v]=d[u]+1;
q.push(v);
}
}
}
return d[t];
}

int dfs(int u,int flow){
if(u==t) return flow;
if(d[u]>=d[t]) return 0;
for(int e=fir[u];~e;e=nex[e]){
int v=to[e];
if(wi[e]&&d[v]==d[u]+1&&(x=dfs(v,min(flow,wi[e])))){
wi[e]-=x;
wi[e^1]+=x;
return x;
}
}
return 0;
}

template<typename T>inline void read(T &aa){
ll ff=1;char cc=getchar();aa=0;
while((cc<'0'||cc>'9')&&cc!='-') cc=getchar();
if(cc=='-') ff=-1,cc=getchar();
while(cc<='9'&&cc>='0') aa=aa*10+cc-48,cc=getchar();
aa*=ff;
}

int main(){
while(T--){
memset(fir,-1,sizeof(fir));
memset(to,0,sizeof(to));
memset(nex,0,sizeof(nex));
memset(wi,0,sizeof(wi));ecnt=0;
tot=0;maxflow=0;x=0;
for(int i=1;i<=n;i++){
}
for(int i=1;i<=n;i++){
}
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++){
if(i==j||know[i][j]){
}