摘要:
很有技巧的并查集 参考了别人的#include
#include
#include
using namespace std;
int high[30005], fa[30005], top[30005], ret[30005];
void init()
{ int i; for(i=0; i=0;i--) { high[ret[i]]+=high[fa[ret[i]]]; fa[ret[i]]=id; } return id;
}
int main()
{ int p, x, y, a, b; char o... 阅读全文
摘要:
并查集 过了#include
#include
#include
using namespace std;
bool pipe[][4]= {1,1,0,0, 0,1,1,0, 1,0,0,1, 0,0,1,1, 0,1,0,1, 1,0,1,0, 1,1,1,0, 1,1,0,1, 1,0,1,1, ... 阅读全文