[문제 링크] : https://www.acmicpc.net/problem/20040#include #include using namespace std;int N, M;int Arr[500001];int Ans;int find(int n){ if(Arr[n] == n){ return n; } else{ return Arr[n] = find(Arr[n]); }}bool solve(int a, int b){ a = find(a); b = find(b); if(a == b){ return true; } else{ Arr[a] = b; return false; }}int main(){ cin..