摘要:
并查集可以判断图的连通性,属于几个集合,相当于每个班的班长是谁,有几个班 并查集模板 #include <bits/stdc++.h> using namespace std; const int N = 1000005; int s[N]; void init_set(){ for(int i=1 阅读全文
摘要:
Codeforces Round 929 (Div. 3) D. Turtle Tenacity: Continual Mods 题意 Given an array \(a_1, a_2, \ldots, a_n\), determine whether it is possible to rear 阅读全文