Language: C++

#include<bits/stdc++.h>
#define ll long long 
using namespace std;
const int mod = 1e9+7;
const int mo = 1e9+7;
inline int read(){int w=1,s=0;char ch=getchar();while(!isdigit(ch)){if(ch=='-')w=-1;ch=getchar();}while(isdigit(ch)){s=s*10+ch-'0';ch=getchar();}return w*s;}
int size[5050];
struct node{
	int to,next;
}e[100010];
ll base[5050],f[5050][5050],g[5050],h[5050],tot,n;
inline void add_edge(int from,int to){e[++tot].next=h[from];h[from]=tot;e[tot].to=to;}
inline void Pre(int now,int ffa){
	size[now]=1;for(register int i=h[now];i;i=e[i].next){int to=e[i].to;if(to==ffa) continue;Pre(to,now);size[now]+=size[to];}
}
inline void DFS(int now,int ffa)
{
	for(register int i=h[now];i;i=e[i].next)
	{
		int to=e[i].to;if(to==ffa) continue;
		DFS(to,now);
	}
	f[now][1]=1;int las=1;
	for(int p=h[now];p;p=e[p].next)
	if (e[p].to!=ffa){
		int y=e[p].to;
		for(register int i=1;i<=las;++i){
			g[i]=f[x][i];
			f[x][i]=0;
		}
		for(register int i=1;i<=las;++i)
			for(register int j=1;j<=size[y];++j){
				f[x][i+j]=(f[x][i+j]+g[i]*f[y][j])%mo;
				if (j%2==0)f[x][i]=(f[x][i]+mo-g[i]*f[y][j]%mo*base[j/2]%mo)%mo;
			}
			las+=size[y];
		}
	}
}
int main()
{
	n=read();
	for(register int i=1,u,v;i<n;++i) u=read(),v=read(),add_edge(u,v),add_edge(v,u);
	base[0]=1;for(register ll i=1;i<=n;++i) base[i]=1ll*base[i-1]*(2*i-1)%mod;
	Pre(1,0);
	DFS(1,0);ll ans=0;
	for(register int i=1;i<=n;++i) if(i%2==0) ans=(ans+f[1][i]*base[i/2]%mod)%mod;
	cout<<ans%mod;
	return 0;
}

Compiler output:
a.cc: In function 'void Pre(int, int)':
a.cc:14:9: error: reference to 'size' is ambiguous
   14 |         size[now]=1;for(register int i=h[now];i;i=e[i].next){int to=e[i].to;if(to==ffa) continue;Pre(to,now);size[now]+=size[to];}
      |         ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:5: note:                 'int size [5050]'
    7 | int size[5050];
      |     ^~~~
a.cc:14:38: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   14 |         size[now]=1;for(register int i=h[now];i;i=e[i].next){int to=e[i].to;if(to==ffa) continue;Pre(to,now);size[now]+=size[to];}
      |                                      ^
a.cc:14:110: error: reference to 'size' is ambiguous
   14 |         size[now]=1;for(register int i=h[now];i;i=e[i].next){int to=e[i].to;if(to==ffa) continue;Pre(to,now);size[now]+=size[to];}
      |                                                                                                              ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:5: note:                 'int size [5050]'
    7 | int size[5050];
      |     ^~~~
a.cc:14:121: error: reference to 'size' is ambiguous
   14 |         size[now]=1;for(register int i=h[now];i;i=e[i].next){int to=e[i].to;if(to==ffa) continue;Pre(to,now);size[now]+=size[to];}
      |                                                                                                                         ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:5: note:                 'int size [5050]'
    7 | int size[5050];
      |     ^~~~
a.cc: In function 'void DFS(int, int)':
a.cc:18:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   18 |         for(register int i=h[now];i;i=e[i].next)
      |                          ^
a.cc:27:34: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   27 |                 for(register int i=1;i<=las;++i){
      |                                  ^
a.cc:28:32: error: 'x' was not declared in this scope
   28 |                         g[i]=f[x][i];
      |                                ^
a.cc:31:34: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   31 |                 for(register int i=1;i<=las;++i)
      |                                  ^
a.cc:32:42: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   32 |                         for(register int j=1;j<=size[y];++j){
      |                                          ^
a.cc:32:49: error: reference to 'size' is ambiguous
   32 |                         for(register int j=1;j<=size[y];++j){
      |                                                 ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:5: note:                 'int size [5050]'
    7 | int size[5050];
      |     ^~~~
a.cc:33:35: error: 'x' was not declared in this scope
   33 |                                 f[x][i+j]=(f[x][i+j]+g[i]*f[y][j])%mo;
      |                                   ^
a.cc:36:30: error: reference to 'size' is ambiguous
   36 |                         las+=size[y];
      |                              ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:5: note:                 'int size [5050]'
    7 | int size[5050];
      |     ^~~~
a.cc: At global scope:
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
a.cc: In function 'int main()':
a.cc:43:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   43 |         for(register int i=1,u,v;i<n;++i) u=read(),v=read(),add_edge(u,v),add_edge(v,u);
      |                          ^
a.cc:43:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   43 |         for(register int i=1,u,v;i<n;++i) u=read(),v=read(),add_edge(u,v),add_edge(v,u);
      |                              ^
a.cc:43:32: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   43 |         for(register int i=1,u,v;i<n;++i) u=read(),v=read(),add_edge(u,v),add_edge(v,u);
      |                                ^
a.cc:44:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   44 |         base[0]=1;for(register ll i=1;i<=n;++i) base[i]=1ll*base[i-1]*(2*i-1)%mod;
      |                                   ^
a.cc:47:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   47 |         for(register int i=1;i<=n;++i) if(i%2==0) ans=(ans+f[1][i]*base[i/2]%mod)%mod;
      |                          ^