Language: C++

#include <iostream>
#include <cstdio>
#define int long long
#define N 5002
using namespace std;
const int mod=1000000007;
int head[N],ver[N*2],nxt[N*2],l;
int n,i,j,c[N],f[N][N],g[N][N],size[N];
int read()
{
	char c=getchar();
	int w=0;
	while(c<'0'||c>'9') c=getchar();
	while(c<='9'&&c>='0'){
		w=w*10+c-'0';
		c=getchar();
	}
	return w;
}
void insert(int x,int y)
{
	l++;
	ver[l]=y;
	nxt[l]=head[x];
	head[x]=l;
}
void dp(int x,int pre)
{
	size[x]=f[x][1]=1;
	for(int i=head[x];i;i=nxt[i]){
		int y=ver[i];
		if(y!=pre){
			dp(y,x);
			for(int j=1;j<=size[x];j++){
				for(int k=1;k<=size[y];k++){
					g[x][j]=(g[x][j]-f[x][j]*f[y][k]%mod*c[k]%mod+mod)%mod;
					g[x][j+k]=(g[x][j+k]+f[x][j]*f[y][k]%mod)%mod;
				}
			}
			size[x]+=size[y];
			for(int j=1;j<=size[x];j++) f[x][j]=g[x][j],g[x][j]=0;
		}
	}
}
signed main()
{
	n=read();
	for(i=1;i<n;i++){
		int u=read(),v=read();
		insert(u,v);insert(v,u);
	}
	for(i=2;i<=n;i+=2){
		c[i]=1;
		for(j=i-1;j>=1;j-=2) c[i]=c[i]*j%mod;
	}
	dp(1,0);
	int ans=0;
	for(i=1;i<=n;i++) ans=(ans+f[1][i]*c[i]%mod)%mod;
	printf("%lld\n",ans);
	return 0;
}
	

Compiler output:
a.cc: In function 'void dp(long long int, long long int)':
a.cc:29:9: error: reference to 'size' is ambiguous
   29 |         size[x]=f[x][1]=1;
      |         ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:8:32: note:                 'long long int size [5002]'
    8 | int n,i,j,c[N],f[N][N],g[N][N],size[N];
      |                                ^~~~
a.cc:34:40: error: reference to 'size' is ambiguous
   34 |                         for(int j=1;j<=size[x];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:8:32: note:                 'long long int size [5002]'
    8 | int n,i,j,c[N],f[N][N],g[N][N],size[N];
      |                                ^~~~
a.cc:35:48: error: reference to 'size' is ambiguous
   35 |                                 for(int k=1;k<=size[y];k++){
      |                                                ^~~~
/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:8:32: note:                 'long long int size [5002]'
    8 | int n,i,j,c[N],f[N][N],g[N][N],size[N];
      |                                ^~~~
a.cc:40:25: error: reference to 'size' is ambiguous
   40 |                         size[x]+=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:8:32: note:                 'long long int size [5002]'
    8 | int n,i,j,c[N],f[N][N],g[N][N],size[N];
      |                                ^~~~
a.cc:40:34: error: reference to 'size' is ambiguous
   40 |                         size[x]+=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:8:32: note:                 'long long int size [5002]'
    8 | int n,i,j,c[N],f[N][N],g[N][N],size[N];
      |                                ^~~~
a.cc:41:40: error: reference to 'size' is ambiguous
   41 |                         for(int j=1;j<=size[x];j++) f[x][j]=g[x][j],g[x][j]=0;
      |                                        ^~~~
/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:8:32: note:                 'long long int size [5002]'
    8 | int n,i,j,c[N],f[N][N],g[N][N],size[N];
      |                                ^~~~