摘要: 就是求图中有多少个水洼。对图进行dfs遍历,并把是水洼的地方全部标记。然后从下一个是水哇的地方再进行dfs。 1 #include <cstdio> 2 #include <iostream> 3 #include <cstring> 4 using namespace std; 5 int gra 阅读全文
posted @ 2014-12-06 11:36 unicoe 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 题目求的是:所有蚂蚁用最短时间从木棍上走下来的最大值(也就是最后一个蚂蚁什么时候走下来的) 所有蚂蚁中,用时最长的情况 PS:根本不用考虑两只蚂蚁相遇又折返的情况(可以直接认为是他两互不影响的走) 1 #include <iostream> 2 3 using namespace std; 4 5 阅读全文
posted @ 2014-12-06 11:12 unicoe 阅读(259) 评论(0) 推荐(0) 编辑