[문제 링크] : https://www.acmicpc.net/problem/10775#include using namespace std;int G, P;int Arr[100001];int Ans;int find(int n){ if(n == Arr[n]){ return n; } return Arr[n] = find(Arr[n]);}void solve(int a, int b){ a = find(a); b = find(b); if(a > b){ swap(a, b); } Arr[b] = a; return;}int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);..