摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1213题意就是说,有n个人参加的party,要准备多少张桌子,使得任意桌子上坐的人都是有联系的。所谓有联系的就是说:比如A 和 B,如果他们两认识,或者存在一些人 C D E...使得A 、B能够认识。求最少要准备的桌子的数量。解法:直接用并查集算法解决。分析:把昨天的代码拿来稍微改了下,果断ac。水题飘过。View Code // I'm lanjiangzhou//C#include <stdio.h>#include <stdlib.h>#include <stri 阅读全文
posted @ 2013-04-08 13:36
南下的小程序员
阅读(201)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1241题意:求连通分量的个数,8个方向。做过好几次了,表示对dfs,bfs真没感觉。嗨。哭死。。。View Code // I'm lanjiangzhou//C#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <math.h>#include <time.h>//C++#include <iostream&g 阅读全文
posted @ 2013-04-08 13:14
南下的小程序员
阅读(199)
评论(0)
推荐(0)

浙公网安备 33010602011771号