Luogu P1197 [JSOI2008]星球大戰

題面 分析 並查集即可,注意由於並查集只能維護集合求並,不能維護集合「相減」,故需要按照摧毀順序倒着運行,變減爲加,這基本上算是並查集的一個較高級的用法了 code #include<bits/stdc++.h> using namespace std; #define loop(i,start,end) for(int i=start;i<=end;i++) #define anti_loop(
相關文章
相關標籤/搜索