ACM_并查集
文章平均质量分 77
ACM_sjtsjt
不忘初心 追求美好
展开
-
hdu 3038 How Many Answers Are Wrong(并查集变种)
How Many Answers Are Wrong Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4639 Accepted Submission(s): 1770 Problem Description TT原创 2016-03-07 19:19:48 · 270 阅读 · 0 评论 -
hdu 1198 Farm Irrigation(并查集强大无比的位运算)
Farm Irrigation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8223 Accepted Submission(s): 3543 Problem Description Benny has a sp原创 2016-03-07 19:50:05 · 359 阅读 · 0 评论 -
hdu 1598 find the most comfortable road(并查集判断图联通)
find the most comfortable road Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5719 Accepted Submission(s): 2477 Problem Description原创 2016-03-07 21:24:39 · 303 阅读 · 0 评论 -
hdu 4496 D-City(并查集逆向思维)
D-City Problem Description Luxer is a really bad guy. He destroys everything he met. One day Luxer went to D-city. D-city has N D-points and M D-lines. Each D-line connects exactly two D-points.原创 2016-03-08 21:51:41 · 307 阅读 · 0 评论 -
hdu 1829 A Bug's Life(种类并查集)
A Bug's Life Problem Description Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only原创 2016-03-08 22:14:38 · 451 阅读 · 0 评论 -
【hdu】5354 Bipartite Graph【cdq分治+并查集】
【题意】:给你一个图,问删除一个节点后,该图还是不是二分图 【题解】:题意很简单,显然数据范围不可能允许我们n方暴力。关于判断二分图我们可以用染色法,也可以使用并查集,染色法每次都需要遍历全图,显然是行不通的,我们这题采用的是cdq分治+并查集,这里的并查集要求不能路径压缩,并且可删除,关于并查集的可删除我们可以每次用一个栈记录新合并之前的节点的状态,还原的时候把栈中储存的信息一个一个拿出来就好原创 2016-08-13 23:13:42 · 496 阅读 · 0 评论