Language: C++

#include<bits/stdc++.h>
using namespace std;
#define long long ll
long long mod = 1e9 + 7; 
pair<ll,ll> dfs(int node,vector<bool> &vis,vector<vector<ll>> &adj)
{
    vis[node] = true;
    ll all_whites = 1;
    ll black = 0;
    for(auto a : adj[node])
    {
        if(!vis[a])
        {
            auto tmp = dfs(a,vis,adj);
            int prev_white = all_whites;
            all_whites = (all_whites * tmp.second)%mod;
            black = (prev_white * tmp.first)%mod + (black * ((tmp.first + tmp.second)%mod))%mod ;
        }
        
    }
    return make_pair(all_whites,(all_whites+black)%mod);
}
int main()
{
    int n;
    cin >> n;
    vector<vector<ll>> adj(n+1);
    vector<bool> vis(n+1);
    for(int i = 0;i<n;i++)
    {
        int u,v;
        cin >> u >> v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    auto tmp = dfs(1,vis,adj);
    cout << (tmp.first + tmp.second)%mod << endl;
}

Compiler output:
a.cc:3:14: error: expected initializer before 'long'
    3 | #define long long ll
      |              ^~~~
a.cc:4:6: note: in expansion of macro 'long'
    4 | long long mod = 1e9 + 7;
      |      ^~~~
a.cc:5:6: error: 'll' was not declared in this scope
    5 | pair<ll,ll> dfs(int node,vector<bool> &vis,vector<vector<ll>> &adj)
      |      ^~
a.cc:5:9: error: 'll' was not declared in this scope
    5 | pair<ll,ll> dfs(int node,vector<bool> &vis,vector<vector<ll>> &adj)
      |         ^~
a.cc:5:11: error: template argument 1 is invalid
    5 | pair<ll,ll> dfs(int node,vector<bool> &vis,vector<vector<ll>> &adj)
      |           ^
a.cc:5:11: error: template argument 2 is invalid
a.cc:5:58: error: 'll' was not declared in this scope
    5 | pair<ll,ll> dfs(int node,vector<bool> &vis,vector<vector<ll>> &adj)
      |                                                          ^~
a.cc:5:58: error: template argument 1 is invalid
a.cc:5:58: error: template argument 2 is invalid
a.cc:5:60: error: template argument 1 is invalid
    5 | pair<ll,ll> dfs(int node,vector<bool> &vis,vector<vector<ll>> &adj)
      |                                                            ^~
a.cc:5:60: error: template argument 2 is invalid
a.cc: In function 'int dfs(int, std::vector<bool>&, int&)':
a.cc:8:5: error: 'll' was not declared in this scope
    8 |     ll all_whites = 1;
      |     ^~
a.cc:9:7: error: expected ';' before 'black'
    9 |     ll black = 0;
      |       ^~~~~~
      |       ;
a.cc:10:21: error: invalid types 'int[int]' for array subscript
   10 |     for(auto a : adj[node])
      |                     ^
a.cc:15:30: error: 'all_whites' was not declared in this scope
   15 |             int prev_white = all_whites;
      |                              ^~~~~~~~~~
a.cc:16:52: error: 'mod' was not declared in this scope; did you mean 'modf'?
   16 |             all_whites = (all_whites * tmp.second)%mod;
      |                                                    ^~~
      |                                                    modf
a.cc:17:13: error: 'black' was not declared in this scope
   17 |             black = (prev_white * tmp.first)%mod + (black * ((tmp.first + tmp.second)%mod))%mod ;
      |             ^~~~~
a.cc:21:22: error: 'all_whites' was not declared in this scope
   21 |     return make_pair(all_whites,(all_whites+black)%mod);
      |                      ^~~~~~~~~~
a.cc:21:45: error: 'black' was not declared in this scope
   21 |     return make_pair(all_whites,(all_whites+black)%mod);
      |                                             ^~~~~
a.cc:21:52: error: 'mod' was not declared in this scope; did you mean 'modf'?
   21 |     return make_pair(all_whites,(all_whites+black)%mod);
      |                                                    ^~~
      |                                                    modf
a.cc: In function 'int main()':
a.cc:27:19: error: 'll' was not declared in this scope
   27 |     vector<vector<ll>> adj(n+1);
      |                   ^~
a.cc:27:19: error: template argument 1 is invalid
a.cc:27:19: error: template argument 2 is invalid
a.cc:27:21: error: template argument 1 is invalid
   27 |     vector<vector<ll>> adj(n+1);
      |                     ^~
a.cc:27:21: error: template argument 2 is invalid
a.cc:33:12: error: invalid types 'int[int]' for array subscript
   33 |         adj[u].push_back(v);
      |            ^
a.cc:34:12: error: invalid types 'int[int]' for array subscript
   34 |         adj[v].push_back(u);
      |            ^
a.cc:37:18: error: request for member 'first' in 'tmp', which is of non-class type 'int'
   37 |     cout << (tmp.first + tmp.second)%mod << endl;
      |                  ^~~~~
a.cc:37:30: error: request for member 'second' in 'tmp', which is of non-class type 'int'
   37 |     cout << (tmp.first + tmp.second)%mod << endl;
      |                              ^~~~~~
a.cc:37:38: error: 'mod' was not declared in this scope; did you mean 'modf'?
   37 |     cout << (tmp.first + tmp.second)%mod << endl;
      |                                      ^~~
      |                                      modf