| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
为什么枚举边的时候必须为容量为0,我们从源点和汇点dfs分别染色,难道满足条件的边不是两个点颜色不一样就足够了吗?for(int i=0;i<n;++i)
{
for(int j=box[i];j!=-1;j=edges[j].next)
if(!(j&1)&&id[i]+id[edges[j].to]==3)//S能到达的染为1,能到达T的染为2
ans++;
}
这样写WA
for(int i=0;i<n;++i)
{
for(int j=box[i];j!=-1;j=edges[j].next)
if(!(j&1)&&id[i]+id[edges[j].to]==3&&edges[j].c==0)
ans++;
}
这样写AC
我开始质疑我对于割集的理解了,请路过的大牛解疑
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator