随笔分类 -  并查集

摘要:Description Description Company A has N employees, this company has lots of departments around the country. The employees who belong to different depa 阅读全文
posted @ 2019-07-29 14:55 明霞 阅读(197) 评论(0) 推荐(0)
摘要:Bear Limak examines a social network. Its main functionality is that two members can become friends (then they can talk with each other and share funn 阅读全文
posted @ 2019-04-02 20:14 明霞 阅读(338) 评论(0) 推荐(0)
摘要:Description Description 平面上有n个矩形,给定每个矩形的左下角坐标和右上角坐标。如果把重合的矩形合并成一个图形,则经过合并之后,还剩多少个图形? 平面上有n个矩形,给定每个矩形的左下角坐标和右上角坐标。如果把重合的矩形合并成一个图形,则经过合并之后,还剩多少个图形? Inpu 阅读全文
posted @ 2019-03-28 19:47 明霞 阅读(279) 评论(0) 推荐(0)
摘要:The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. H 阅读全文
posted @ 2019-03-15 21:24 明霞 阅读(311) 评论(0) 推荐(0)
摘要:Description Description 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种 阅读全文
posted @ 2019-03-14 21:20 明霞 阅读(246) 评论(0) 推荐(0)
摘要:Description Description lmh平常爱听歌,所以买了很多的CD来收藏,但是因为平常整理不当,所以忘记了这些CD的歌手是谁。现在他想知道他到底收藏了多少位歌手的专辑,于是他想了一个办法,同时拿出两个CD来听,可以分辨出来是否为同一个歌手唱的。(如果没有说明则认为是没有分辨出来,为 阅读全文
posted @ 2019-02-14 22:46 明霞 阅读(267) 评论(0) 推荐(0)