func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m;   const int N = 1e6, M = 1e6;   pair<int, int> adj[M + 7];   long long val[N + 7];   long long sum[N + 7];   long long res = 0;   mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());   void addRes(int numb) { res += 1LL * numb * (numb - 1) / 2; }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n >> m;     for (int i = 1, r1, r2; i <= m; i++) {       cin >> r1 >> r2;       adj[i] = {r1, r2};     }     for (int i = 1; i <= n; i++) {       val[i] = rng();       sum[i] = 0;     }     for (int i = 1; i <= m; i++) {       sum[adj[i].first] += val[adj[i].second];       sum[adj[i].second] += val[adj[i].first];     }     int u, v;     for (int i = 1; i <= m; i++) {       u = adj[i].first;       v = adj[i].second;       if (sum[u] - val[v] == sum[v] - val[u]) res++;     }     int start = 1, finish = 1;     sort(sum + 1, sum + n + 1);     for (int i = 2; i <= n; i++)       if (sum[i] == sum[i - 1]) {         finish = i;         if (i == n) addRes(finish - start + 1);       } else {         addRes(finish - start + 1);         start = finish = i;       }     cout << res;     return 0;   }   