#include <iostream> #include <bits/stdc++.h> using namespace std; #define int long long unordered_map<int,int> mp1,mp2; // mp1记录节点i的父节点j,mp2记录节点i的邻居白点数 int find(int x) { return mp1[x]==x?x:mp1[x]=find(mp1[x]); } // 快速乘 int mul(int a,int b) { a = a%(1000000007LL); b = b%(1000000007L...