摘要: 链接:http://acm.hdu.edu.cn/showproblem.php?pid=3715用a[i]表示a[i]对应的x[a[i]]是0,a[i]+n表示是1,则当c[i]=0时,不能同时为0,则a[i]->b[i]+n,b[i]->a[i]+n当c[i]=1时,a[i]->b[i],b[i]->a[i],a[i]+n->b[i]+n,b[i]+n->a[i]+n;当c[i]=2时,a[i]+n->b[i],b[i]+n->a[i];最后如果二分枚举深度值,要用到二分枚举View Code #include<iostream> 阅读全文
posted @ 2012-08-15 19:21 zhenhai 阅读(157) 评论(0) 推荐(0)