Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <algorithm>#include <iostream>#include <cstring>using namespace std;typedef long long LL;const LL inf = 0x3f3f3f3f;static const int N = 1000100;int arr[N];int par[N];int edge[N];int V[N];int p[N];int res[N];int use[N];int find(int x) {if (par[x] == x) {return x;}return par[x] = find(par[x]);}int main() {int t, icase = 1 , u1 , v1;cin >> t;while (t--){int n, m, k;cin >> n >> m >> k;