easy的题目当然要easy的解 #include<iostream> #include<map> #include<vector> #include<algorithm> using namespace std; int find(map<int, int> mp, int x) { if (mp[x] != x) mp[x] = find(mp, mp[x]); return mp[x]; } int main() { int n, w; map<int, int> mp; map<int, int> di...