Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>
#include <climits>

using namespace std;

vector<vector<ll>> dp;

const ll mod = 1e9 + 7;

void dfs(vector<vector<int>> &g, int v, int p) {
    bool isLeaf = true;
    for (int next : g[v]) {
        if (next != p) {
            dfs(g, next, v);
            isLeaf = false;
        }
    }
    if (isLeaf) {
        dp[v][1] = 1;
        dp[v][2] = 1;
        return;
    } else {
        for (int next : g[v]) {
            if (next != p) {
                dp[v][2] += dp[next][1];
                dp[v][2] %= mod;
                dp[v][1] += (dp[next][1] + dp[next][2]);
                dp[v][1] %= mod;
            }
        }
        return;
    }
}

int main() {
    //freopen("input.txt", "rt", stdin);
    //freopen("output.txt", "wt", stdout);
    int n;
    scanf("%d", &n);
    vector<vector<int>> g(n + 1);
    for (int i = 1; i < n; i++) {
        int x, y;
        scanf("%d %d", &x, &y);
        g[x].push_back(y);
        g[y].push_back(x);
    }
    vector<vector<ll>> temp(n + 1, vector<ll>(2 + 1, 0));
    dp = temp;
    dfs(g, 1, -1);
    printf("%lld", (dp[1][1] + dp[1][2]) % mod);
    return 0;
}

Compiler output:
a.cc:8:15: error: 'll' was not declared in this scope
    8 | vector<vector<ll>> dp;
      |               ^~
a.cc:8:15: error: template argument 1 is invalid
a.cc:8:15: error: template argument 2 is invalid
a.cc:8:17: error: template argument 1 is invalid
    8 | vector<vector<ll>> dp;
      |                 ^~
a.cc:8:17: error: template argument 2 is invalid
a.cc:10:7: error: 'll' does not name a type
   10 | const ll mod = 1e9 + 7;
      |       ^~
a.cc: In function 'void dfs(std::vector<std::vector<int> >&, int, int)':
a.cc:21:11: error: invalid types 'int[int]' for array subscript
   21 |         dp[v][1] = 1;
      |           ^
a.cc:22:11: error: invalid types 'int[int]' for array subscript
   22 |         dp[v][2] = 1;
      |           ^
a.cc:27:19: error: invalid types 'int[int]' for array subscript
   27 |                 dp[v][2] += dp[next][1];
      |                   ^
a.cc:27:31: error: invalid types 'int[int]' for array subscript
   27 |                 dp[v][2] += dp[next][1];
      |                               ^
a.cc:28:19: error: invalid types 'int[int]' for array subscript
   28 |                 dp[v][2] %= mod;
      |                   ^
a.cc:28:29: error: 'mod' was not declared in this scope
   28 |                 dp[v][2] %= mod;
      |                             ^~~
a.cc:29:19: error: invalid types 'int[int]' for array subscript
   29 |                 dp[v][1] += (dp[next][1] + dp[next][2]);
      |                   ^
a.cc:29:32: error: invalid types 'int[int]' for array subscript
   29 |                 dp[v][1] += (dp[next][1] + dp[next][2]);
      |                                ^
a.cc:29:46: error: invalid types 'int[int]' for array subscript
   29 |                 dp[v][1] += (dp[next][1] + dp[next][2]);
      |                                              ^
a.cc:30:19: error: invalid types 'int[int]' for array subscript
   30 |                 dp[v][1] %= mod;
      |                   ^
a.cc: In function 'int main()':
a.cc:49:19: error: 'll' was not declared in this scope
   49 |     vector<vector<ll>> temp(n + 1, vector<ll>(2 + 1, 0));
      |                   ^~
a.cc:49:19: error: template argument 1 is invalid
a.cc:49:19: error: template argument 2 is invalid
a.cc:49:21: error: template argument 1 is invalid
   49 |     vector<vector<ll>> temp(n + 1, vector<ll>(2 + 1, 0));
      |                     ^~
a.cc:49:21: error: template argument 2 is invalid
a.cc:49:45: error: template argument 2 is invalid
   49 |     vector<vector<ll>> temp(n + 1, vector<ll>(2 + 1, 0));
      |                                             ^
a.cc:49:56: error: expression list treated as compound expression in initializer [-fpermissive]
   49 |     vector<vector<ll>> temp(n + 1, vector<ll>(2 + 1, 0));
      |                                                        ^
a.cc:52:23: error: invalid types 'int[int]' for array subscript
   52 |     printf("%lld", (dp[1][1] + dp[1][2]) % mod);
      |                       ^
a.cc:52:34: error: invalid types 'int[int]' for array subscript
   52 |     printf("%lld", (dp[1][1] + dp[1][2]) % mod);
      |                                  ^
a.cc:52:44: error: 'mod' was not declared in this scope
   52 |     printf("%lld", (dp[1][1] + dp[1][2]) % mod);
      |                                            ^~~