摘要: #include#includeusing namespace std;const int N=40010;int pre[N];//并查集int visit[N];//是否经过int ancestor[N];//祖先int dis[N];//储存距离int result[N];//储存结果stru... 阅读全文
posted @ 2013-11-26 22:58 HYDhyd 阅读(103) 评论(0) 推荐(0) 编辑
摘要: #include#includeusing namespace std;const int MAX=10001;int pre[MAX],visit[MAX],indegree[MAX];vectorqury[MAX],tree[MAX];int ancestor[MAX];void init(in... 阅读全文
posted @ 2013-11-26 20:56 HYDhyd 阅读(152) 评论(0) 推荐(0) 编辑