Language: C++

#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <deque>
#include <queue>
#include <map>
#include <stack>
#include <vector>
using namespace std;
 
 
const int mod=1e9+7;
const int maxn=1e6+10;
 
 
map<__int64,__int64> mp;
vector<int> g[maxn];
 
 __int64 d[maxn];


__int64 ans;

int n; 

 
void dfs(int u,int fa){
    d[u]=1;
    for(int i=0;i<g[u].size();++i)
	{
        int v=g[u][i];
        if(v==fa)continue;
        dfs(v,u);
        d[u]+=d[v]*mod;
    }
    mp[d[u]]++;
}
 
 

int main()
{
	while(~scanf("%d",&n))
    {
    	
    	for(int i=0; i<=n; i++)
            g[i].clear();
        mp.clear();
        ans=0;
        for(int i=1;i<n;i++)
		{
            int u,v;
			scanf("%d%d",&u,&v);
            g[u].push_back(v);
			g[v].push_back(u);
        }
      
        dfs(1,0);
        for(map<unsigned __int64,__int64>::iterator it=mp.begin(); it!=mp.end(); it++)
            ans+=(__int64)it->second*(it->second-1)/2;
        cout<<ans<<endl;
    }
    return 0; 
}


Compiler output:
a.cc:18:5: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
   18 | map<__int64,__int64> mp;
      |     ^~~~~~~
      |     __ynf64
a.cc:18:13: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
   18 | map<__int64,__int64> mp;
      |             ^~~~~~~
      |             __ynf64
a.cc:18:20: error: template argument 1 is invalid
   18 | map<__int64,__int64> mp;
      |                    ^
a.cc:18:20: error: template argument 2 is invalid
a.cc:18:20: error: template argument 3 is invalid
a.cc:18:20: error: template argument 4 is invalid
a.cc:21:2: error: '__int64' does not name a type; did you mean '__int64_t'?
   21 |  __int64 d[maxn];
      |  ^~~~~~~
      |  __int64_t
a.cc:24:1: error: '__int64' does not name a type; did you mean '__int64_t'?
   24 | __int64 ans;
      | ^~~~~~~
      | __int64_t
a.cc: In function 'void dfs(int, int)':
a.cc:30:5: error: 'd' was not declared in this scope
   30 |     d[u]=1;
      |     ^
a.cc: In function 'int main()':
a.cc:50:12: error: request for member 'clear' in 'mp', which is of non-class type 'int'
   50 |         mp.clear();
      |            ^~~~~
a.cc:51:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   51 |         ans=0;
      |         ^~~
      |         abs
a.cc:61:41: error: wrong number of template arguments (1, should be at least 2)
   61 |         for(map<unsigned __int64,__int64>::iterator it=mp.begin(); it!=mp.end(); it++)
      |                                         ^
In file included from /usr/include/c++/14/map:63,
                 from a.cc:8:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:61:53: error: qualified-id in declaration before 'it'
   61 |         for(map<unsigned __int64,__int64>::iterator it=mp.begin(); it!=mp.end(); it++)
      |                                                     ^~
a.cc:61:52: error: expected ';' before 'it'
   61 |         for(map<unsigned __int64,__int64>::iterator it=mp.begin(); it!=mp.end(); it++)
      |                                                    ^~~
      |                                                    ;
a.cc:61:53: error: 'it' was not declared in this scope; did you mean 'int'?
   61 |         for(map<unsigned __int64,__int64>::iterator it=mp.begin(); it!=mp.end(); it++)
      |                                                     ^~
      |                                                     int
a.cc:61:59: error: request for member 'begin' in 'mp', which is of non-class type 'int'
   61 |         for(map<unsigned __int64,__int64>::iterator it=mp.begin(); it!=mp.end(); it++)
      |                                                           ^~~~~
a.cc:61:75: error: request for member 'end' in 'mp', which is of non-class type 'int'
   61 |         for(map<unsigned __int64,__int64>::iterator it=mp.begin(); it!=mp.end(); it++)
      |                                                                           ^~~
a.cc:61:80: error: expected ')' before ';' token
   61 |         for(map<unsigned __int64,__int64>::iterator it=mp.begin(); it!=mp.end(); it++)
      |            ~                                                                   ^
      |                                                                                )
a.cc:61:82: error: 'it' was not declared in this scope; did you mean 'int'?
   61 |         for(map<unsigned __int64,__int64>::iterator it=mp.begin(); it!=mp.end(); it++)
      |                                                                                  ^~
      |                                                                                  int