Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll Mod = 1000000007;
const int MaxN = 5010;

int n, tot, size[MaxN], g[MaxN], head[MaxN], ver[MaxN * 2], Next[MaxN * 2];
ll tmp[MaxN], dp[MaxN][MaxN];

void add(int u, int v) {
	ver[++tot] = v;
	Next[tot] = head[u];
	head[u] = tot;
}

void dfs(int u, int fa) {
	size[u] = 1;
	dp[u][1] = 1;
	for (int i = head[u]; i; i = Next[i]) {
		int v = ver[i];
		if (v == fa) continue;
		dfs(v, u);
		for (int j = 1; j <= size[u] + size[v]; j++) tmp[j] = 0;
		for (int j = 1; j <= size[u]; j++)
			for (int k = 0; k <= size[v]; k++) {
				tmp[j + k] += dp[u][j] * dp[v][k] % Mod;
				if (tmp[j + k] >= Mod) tmp[j + k] -= Mod;
			}
		for (int j = 1; j <= size[u] + size[v]; j++)
			dp[u][j] = tmp[j];
		size[u] += size[v];
	}
	for (int i = 2; i <= size[u]; i += 2) {
		dp[u][0] -= dp[u][i] * g[i] % Mod;
		if (dp[u][0] < 0) dp[u][0] += Mod; 
	}
}

int main() {
	scanf("%d", &n);
	for (int i = 1; i < n; i++) {
		int u, v;
		scanf("%d%d", &u, &v);
		add(u, v); add(v, u);
	}
	g[2] = 1; 
	for (int i = 4; i <= n; i += 2)
		g[i] = g[i - 2] * (i - 1);
	dfs(1, 0);
	printf("%lld\n", Mod - dp[1][0]);
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:17:9: error: reference to 'size' is ambiguous
   17 |         size[u] = 1;
      |         ^~~~
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:13: note:                 'int size [5010]'
    7 | int n, tot, size[MaxN], g[MaxN], head[MaxN], ver[MaxN * 2], Next[MaxN * 2];
      |             ^~~~
a.cc:23:38: error: reference to 'size' is ambiguous
   23 |                 for (int j = 1; j <= size[u] + size[v]; j++) tmp[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:7:13: note:                 'int size [5010]'
    7 | int n, tot, size[MaxN], g[MaxN], head[MaxN], ver[MaxN * 2], Next[MaxN * 2];
      |             ^~~~
a.cc:23:48: error: reference to 'size' is ambiguous
   23 |                 for (int j = 1; j <= size[u] + size[v]; j++) tmp[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:7:13: note:                 'int size [5010]'
    7 | int n, tot, size[MaxN], g[MaxN], head[MaxN], ver[MaxN * 2], Next[MaxN * 2];
      |             ^~~~
a.cc:24:38: error: reference to 'size' is ambiguous
   24 |                 for (int j = 1; j <= size[u]; 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:13: note:                 'int size [5010]'
    7 | int n, tot, size[MaxN], g[MaxN], head[MaxN], ver[MaxN * 2], Next[MaxN * 2];
      |             ^~~~
a.cc:25:46: error: reference to 'size' is ambiguous
   25 |                         for (int k = 0; k <= size[v]; 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:7:13: note:                 'int size [5010]'
    7 | int n, tot, size[MaxN], g[MaxN], head[MaxN], ver[MaxN * 2], Next[MaxN * 2];
      |             ^~~~
a.cc:29:38: error: reference to 'size' is ambiguous
   29 |                 for (int j = 1; j <= size[u] + size[v]; 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:13: note:                 'int size [5010]'
    7 | int n, tot, size[MaxN], g[MaxN], head[MaxN], ver[MaxN * 2], Next[MaxN * 2];
      |             ^~~~
a.cc:29:48: error: reference to 'size' is ambiguous
   29 |                 for (int j = 1; j <= size[u] + size[v]; 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:13: note:                 'int size [5010]'
    7 | int n, tot, size[MaxN], g[MaxN], head[MaxN], ver[MaxN * 2], Next[MaxN * 2];
      |             ^~~~
a.cc:31:17: error: reference to 'size' is ambiguous
   31 |                 size[u] += size[v];
      |                 ^~~~
/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:13: note:                 'int size [5010]'
    7 | int n, tot, size[MaxN], g[MaxN], head[MaxN], ver[MaxN * 2], Next[MaxN * 2];
      |             ^~~~
a.cc:31:28: error: reference to 'size' is ambiguous
   31 |                 size[u] += size[v];
      |                            ^~~~
/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:13: note:                 'int size [5010]'
    7 | int n, tot, size[MaxN], g[MaxN], head[MaxN], ver[MaxN * 2], Next[MaxN * 2];
      |             ^~~~
a.cc:33:30: error: reference to 'size' is ambiguous
   33 |         for (int i = 2; i <= size[u]; i += 2) {
      |                              ^~~~
/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:13: note:                 'int size [5010]'
    7 | int n, tot, size[MaxN], g[MaxN], head[MaxN], ver[MaxN * 2], Next[MaxN * 2];
      |             ^~~~