2011年7月22日
摘要: 题目:http://poj.org/problem?id=2492方法一:用mark数组标记如果mark[x]%2==mark[y]%2那么xy就是同性的View Code #include<stdio.h>int father[2002],mark[2002];int find(int x){ int i=x; int j=father[x]; if(x!=father[x]) father[x]=find(father[x]); mark[x]=(mark[x]+mark[j])%2;////////////x与祖先的关系是由x与父节点的关系和父节点和祖先的关系决定的 whil 阅读全文
posted @ 2011-07-22 15:09 渲染独白 阅读(177) 评论(0) 推荐(0)