题目链接:https://ac.nowcoder.com/acm/problem/14254题目大意: 思路:参考大佬的思路: #include <bits/stdc++.h> using namespace std; map<int, int> mp[1005]; int cloer[1005][1005]; int vis[2005]; void dfs(int x, int y, int c1, int c2){ int to=cloer[y][c1]; cloer[x][c1]=y, cloer[y][c1]=x;//强行把x-y染成c1。...