zhber 有好多做过的题没写下来，如果我还能记得就补吧

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

ˆ ˆ

## HINT

#include<cstdio>
#include<cstring>
#define S 0
#define T 1001
#define inf 0x7fffffff
struct edge{
int to,next,v;
}e[5001];
int q[20001];
int n,cnt,ans;
inline int min(int a,int b){return a<b?a:b;}
inline void ins(int u,int v,int w)
{
e[++cnt].to=v;
e[cnt].v=w;
}
inline void insert(int u,int v,int w)
{
ins(u,v,w);
ins(v,u,0);
}
{
int x=0;char ch=getchar();
while(ch<'0'||ch>'9')ch=getchar();
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x;
}
bool school[1001];
inline bool bfs()
{
memset(h,-1,sizeof(h));
int t=0,w=1;
q[1]=S;h[S]=0;
while (t<w)
{
int now=q[++t];
{
if (e[j].v&&h[e[j].to]==-1)
{
q[++w]=e[j].to;
h[e[j].to]=h[now]+1;
}
}
}
if (h[T]==-1) return 0;
return 1;
}
inline int dfs(int x,int f)
{
if (x==T||f==0) return f;
int w,used=0;
{
if (e[i].v&&h[e[i].to]==h[x]+1)
{
w=used;
w=dfs(e[i].to,min(e[i].v,f-used));
e[i].v-=w;
e[i^1].v+=w;
used+=w;
if (used==f) return f;
}
}
if (!used) h[x]==-1;
return used;
}
inline void dinic()
{while (bfs()) ans-=dfs(S,inf);}
inline void work()
{
ans=0;cnt=1;
memset(e,0,sizeof(e));
for (int i=1;i<=n;i++)
{
if (school[i])insert(i+n,T,1);
}
for (int i=1;i<=n;i++)
{
if (!school[i]||(school[i]&&!x))
{
insert(S,i,1);
ans++;
}
}
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
{
if (i==j||x)insert(i,j+n,1);
}
dinic();
if (ans==0) printf("^_^\n");
else printf("T_T\n");
}
int main()
{
}