![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
-----graph
文章平均质量分 81
hexiecs
Follow my heart.
展开
-
并查集水题 POJ2524
题意:一所学校有有n个学生,询问m对学生的宗教是否相同,求出这所学校最多有多少种宗教。 把宗教相同的学生连一条边,则未询问的学生默认他们没有边,最后连通块的个数就是宗教最多有多少个,并查集实现,把每个节点的最终父节点存到数组里,数组里不同元素的个数即为连通块的个数。 代码: #include #include #include #include #include原创 2015-05-18 00:06:18 · 1016 阅读 · 2 评论 -
UVA 784 Maze Exploration
题目如下: Maze Exploration A maze of rectangular rooms is represented on a twodimensional grid as illustrated in figure 1a. Each point of thegrid is represented by a character.原创 2014-06-30 17:26:13 · 963 阅读 · 0 评论 -
UVA 705 Slash Maze
题目如下: Slash Maze By filling a rectangle with slashes (/) and backslashes (), youcan generate nice little mazes. Here is an example: As you can see, paths in the maze cann原创 2014-07-01 19:57:48 · 965 阅读 · 0 评论 -
UVA Knight Moves
题目如下: Knight Moves A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each sq原创 2014-07-02 00:58:47 · 1179 阅读 · 0 评论 -
UVA 532 Dungeon Master
题目如下: Dungeon Master You are trapped in a 3D dungeon and need to find the quickest way out!The dungeon is composedof unit cubes which may or may not be filled with rock. It原创 2014-07-02 14:17:15 · 920 阅读 · 0 评论 -
UVA 10557 XYZZY
题目如下: Problem D: XYZZY ADVENT: /ad�vent/, n. The prototypical computer adventure game, first designed by Will Crowther on the PDP-10 in the mid-1970s as an attempt at computer-refereed fantasy原创 2014-07-02 23:54:54 · 1047 阅读 · 0 评论 -
UVA 10047 - The Monocycle
题目如下: Problem A: The Monocycle A monocycle is a cycle that runs on one wheel and the one we will be considering is a bit more special. It has a solid wheel colored with fiv原创 2014-07-04 13:39:23 · 1155 阅读 · 0 评论 -
UVA 10004 Bicoloring
题目如下: Bicoloring In 1976 the ``Four Color Map Theorem" was proven with the assistance of acomputer. This theorem states that every map can be colored using only fourcolors, in原创 2014-07-04 13:51:44 · 896 阅读 · 0 评论 -
UVA 10129 Play on Words
题目如下: Play on Words Some of the secret doorscontain a very interesting word puzzle. The team of archaeologists has tosolve it to open that doors. Because there is no other way to open the doors,原创 2014-07-04 16:16:40 · 1449 阅读 · 0 评论 -
UVA Oil Deposits
题目如下: Oil Deposits The GeoSurvComp geologic survey company is responsible for detectingunderground oil deposits. GeoSurvComp works with one large rectangularregion of land a原创 2014-06-21 00:47:43 · 1036 阅读 · 0 评论