
并查集
至此曾经
从未坚持?
展开
-
LA4487 加权并查集
点击打开链接异或具有很多奇妙的性质: - aa ^ bb = bb ^ aa; - (aa ^ bb) ^ cc = aa ^ (bb ^ cc); - 若aa ^ bb = cc,那么aa ^ cc = bb。若XpXp XORXOR XqXq = vv,那么我们可以把XpXp与XqXq连一条边,权值为vv。 若XpXp = vv,那么就有XpXp XORXOR 00 = vv,所以我们可以把X...原创 2018-05-06 20:45:46 · 338 阅读 · 0 评论 -
Beauty of Trees 2018华中科技大学程序设计竞赛决赛同步赛A
It’s universally acknowledged that there’re innumerable trees in the campus of HUST. One day the tree manager wants to play a game with you. There are N trees lining up in a straight road. The beauty ...原创 2018-05-06 21:29:11 · 463 阅读 · 0 评论