摘要:
并查集(Disjoint-Set)是一种可以维护若干个不重叠的集合。它的基本操作有两个: GET 查询一个元素属于哪个集合 MERGE 合并两个集合成为一个集合,就是将其中一个父结点指向另一个父结点 在查询的过程中,我们可以利用回溯顺便将路径中所有元素指向父结点,这个操作称为路径压缩。 模板: in 阅读全文
摘要:
Stars Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let th 阅读全文
摘要:
poj1198: Solitaire Solitaire is a game played on a chessboard 8x8. The rows and columns of the chessboard are numbered from 1 to 8, from the top to th 阅读全文