摘要: ```cpp int read() { int w=1, s=0; char ch=getchar(); while(ch'9') { if(ch==' ') w= 1; ch=getchar(); } while(ch ='0'&& ch 阅读全文
posted @ 2019-03-05 17:09 LFYZOI题解 阅读(246) 评论(0) 推荐(0) 编辑
摘要: ```cpp include include include include using namespace std; const int maxn = 1e4 + 5; int f[maxn]; int n, m; inline int Find(int x) { return f[x] == x 阅读全文
posted @ 2019-03-05 17:02 LFYZOI题解 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 空间复杂度:O(N+E) 时间复杂度:O(ElogE) cpp include include include include using namespace std; const int maxn=5e3+5, maxm=2e5+5; int f[maxn], n, m; //f为并查集数组 st 阅读全文
posted @ 2019-03-05 08:47 LFYZOI题解 阅读(149) 评论(0) 推荐(0) 编辑