hdu 4514
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=4514题意:先判断给定的图中是否有环,没有则对森林进行求最长路。思路:dfs判断是否有环,然后对每棵树,两次dfs求最长路,最后取最大的。View Code #include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#pragma comment(linker, "/STACK:36777216")//开大点栈using namespace std; 阅读全文
posted @ 2013-03-23 10:57 aigoruan 阅读(219) 评论(0) 推荐(0) 编辑