随笔分类 -  搜索(BFS DFS)

摘要:二分图判定给定一个图,要给图上每个顶点染色,并且要使得相邻的顶点颜色不同。问是否能最多用2种颜色进行染色?参考如下:Source Code:#include #include using namespace std;vector Edge[1010];int colorArr[1010];void ... 阅读全文
posted @ 2015-01-18 20:52 tinylcy 阅读(221) 评论(0) 推荐(0)
摘要:Lake CountingDescriptionDue to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (... 阅读全文
posted @ 2015-01-11 22:00 tinylcy 阅读(207) 评论(0) 推荐(0)