Language: C++

#define rep(i, a, b) for (int i = a; i < b; ++i)
#define repr(i,a,b) for (int i = a; i > b; --i)
#define mm(lamb, tttt) memset(lamb, tttt, sizeof lamb)
 
#define null NULL
#define eps 0.000000001
#define mod 1000000007
#define PI 3.14159265358979323846
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define ALL(V) V.begin(#define rep(i, a, b) for (int i = a; i < b; ++i)
#define repr(i,a,b) for (int i = a; i > b; --i)
#define mm(lamb, tttt) memset(lamb, tttt, sizeof lamb)
 
#define null NULL
#define eps 0.000000001
#define mod 1000000007
#define PI 3.14159265358979323846
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define ALL(V) V.begin(), V.end()
#define sz(V) (int)V.size()
#define _ <<" "<<
 
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long int ll;
typedef vector <int> vi;
typedef vector<vi> vvi;
typedef pair <int, int> ii;
typedef pair<int, pair<int,int> > iii;
typedef vector<ii> vii;
vector<int >v[200000];
ll dp[200000][2];
bool visited[200000];
ll dfs(int x)
{
	//cout<<x<<endl;
	visited[x] = 1;
	ll b = 1;
	ll w = 1;
	if(v[x].size() == 1 && visited[v[x][0]] == 1)
	{
		//cout<<x<<"hfoi"<<endl;
		dp[x][0] = 1;
		dp[x][1] = 1;
		return 2;
	}

	for(int i=0;i<v[x].size();i++)
	{
		
		if(visited[ v[x][i] ] == 0)
		{
			dfs(v[x][i]);
			//cout<<v[x][i] _ dp[v[x][i]][1] _ dp[v[x][i]][0]<<endl;
			b = (b* dp[ v[x][i] ][1]) % mod;
			w = (w*((dp[v[x][i]][1] + dp[v[x][i]][0])%mod) )%mod;
		}
		

		
	}

	dp[x][0] = b;
	dp[x][1] = w;
	return (b+w)%mod;

}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
 	
	freopen ("test.txt","r",stdin);
	int n;cin>>n;
	if(n==1)
	{
		cout<<2;return 0;
	}
	for (int i = 0; i < n; ++i)
	{
		int x,y;
		cin>>x>>y;
		v[x].pb(y);
		v[y].pb(x);
	}


	cout<<dfs(1);
}	), V.end()
#define sz(V) (int)V.size()
#define _ <<" "<<
 
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long int ll;
typedef vector <int> vi;
typedef vector<vi> vvi;
typedef pair <int, int> ii;
typedef pair<int, pair<int,int> > iii;
typedef vector<ii> vii;
vector<int >v[200000];
ll dp[200000][2];
bool visited[200000];
ll dfs(int x)
{
	//cout<<x<<endl;
	visited[x] = 1;
	ll b = 1;
	ll w = 1;
	if(v[x].size() == 1 && visited[v[x][0]] == 1)
	{
		//cout<<x<<"hfoi"<<endl;
		dp[x][0] = 1;
		dp[x][1] = 1;
		return 2;
	}

	for(int i=0;i<v[x].size();i++)
	{
		
		if(visited[ v[x][i] ] == 0)
		{
			dfs(v[x][i]);
			//cout<<v[x][i] _ dp[v[x][i]][1] _ dp[v[x][i]][0]<<endl;
			b = (b* dp[ v[x][i] ][1]) % mod;
			w = (w*((dp[v[x][i]][1] + dp[v[x][i]][0])%mod) )%mod;
		}
		

		
	}

	dp[x][0] = b;
	dp[x][1] = w;
	return (b+w)%mod;

}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
 	
	//freopen ("test.txt","r",stdin);
	int n;cin>>n;
	if(n==1)
	{
		cout<<2;return 0;
	}
	for (int i = 0; i < n; ++i)
	{
		int x,y;
		cin>>x>>y;
		v[x].pb(y);
		v[y].pb(x);
	}


	cout<<dfs(1);
}

Compiler output:
a.cc:14:14: error: '#' is not followed by a macro parameter
   14 | #define ALL(V) V.begin(#define rep(i, a, b) for (int i = a; i < b; ++i)
      |              ^
a.cc:99:9: error: expected unqualified-id before ')' token
   99 | }       ), V.end()
      |         ^
a.cc:113:13: error: redefinition of 'std::vector<int> v [200000]'
  113 | vector<int >v[200000];
      |             ^
a.cc:41:13: note: 'std::vector<int> v [200000]' previously declared here
   41 | vector<int >v[200000];
      |             ^
a.cc:114:4: error: redefinition of 'll dp [200000][2]'
  114 | ll dp[200000][2];
      |    ^~
a.cc:42:4: note: 'll dp [200000][2]' previously declared here
   42 | ll dp[200000][2];
      |    ^~
a.cc:115:6: error: redefinition of 'bool visited [200000]'
  115 | bool visited[200000];
      |      ^~~~~~~
a.cc:43:6: note: 'bool visited [200000]' previously declared here
   43 | bool visited[200000];
      |      ^~~~~~~
a.cc:116:4: error: redefinition of 'll dfs(int)'
  116 | ll dfs(int x)
      |    ^~~
a.cc:44:4: note: 'll dfs(int)' previously defined here
   44 | ll dfs(int x)
      |    ^~~
a.cc:150:5: error: redefinition of 'int main()'
  150 | int main()
      |     ^~~~
a.cc:78:5: note: 'int main()' previously defined here
   78 | int main()
      |     ^~~~