criyle/codenet-compile-errors huggingface dataset:
Language: Java

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod=1000000007;
ll dp[1<<21];
int main()
{
    ll n;
    cin>>n;
    ll a[n][n];
    for(ll i=0;i<n;i++)
        for(ll j=0;j<n;j++)
            cin>>a[i][j];
    ll mx=1<<n;

    for(ll i=0;i<mx;i++)
        dp[i]=0;
    dp[0]=1;
    for(ll i=0;i<n;i++)
    {
        for(ll j=mx-1;j>=0;j--)
        {
            if(__builtin_popcount(j)!=(i+1))
                dp[j]=0;
            else
            {
                dp[j]=0;
                for(ll k=0;k<n;k++)
                    if((j&(1<<k))&&(a[i][k]))
                        dp[j]=(dp[j]+dp[j^(1<<k)])%mod;
            }
        }
    }
    cout<<dp[mx-1]<<endl;
    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include<bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<bits/stdc++.h>
        ^
Main.java:3: error: class, interface, enum, or record expected
typedef long long ll;
^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
ll mod=1000000007;
^
  (use --enable-preview to enable unnamed classes)
Main.java:5: error: class, interface, enum, or record expected
ll dp[1<<21];
^
Main.java:9: error: not a statement
    cin>>n;
       ^
Main.java:10: error: not a statement
    ll a[n][n];
         ^
Main.java:10: error: not a statement
    ll a[n][n];
            ^
Main.java:13: error: not a statement
            cin>>a[i][j];
               ^
Main.java:34: error: not a statement
    cout<<dp[mx-1]<<endl;
                  ^
Main.java:10: error: ';' expected
    ll a[n][n];
          ^
Main.java:10: error: ';' expected
    ll a[n][n];
             ^
12 errors
Language: C++

#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
using namespace std;
struct Grid{int x,y,t;};
struct Edge{int to,cost;};
struct Graph{vector<vector<Edge>>E;int V;
  const ll Inf = llINF;const int MAX_V=1010;vector<ll>d;
  Graph(int n):E(n){d.resize(MAX_V);E.resize(n);V=n;}
  void init(){for(int i=0;i<MAX_V;i++)d[i]=Inf;}
  void add_edge(int from,int to,int cost){E[from-1].pb({to-1,cost});}
};
int main(){
  int n;cin>>n;
  ll dp[n+1][(1<<22]={};
  ll num[n+2][n+2]={};
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      cin>>num[i][j];
    }
  }
  dp[0][0]=1;
  for(int i=0;i<n;i++){
    for(int j=0;j<(1<<n);j++){
      if(dp[i][j]){
	for(int k=0;k<n;k++){
	  if(!((1<<k) & j) && num[i][k]){
	    dp[i+1][j | (1<<k)]+=(dp[i][j]);
	    dp[i+1][j | (1<<k)]%=MOD;
	  }
	}
      }
    }
  }
  cout<<dp[n][(1<<n)-1]<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: expected ')' before ']' token
   25 |   ll dp[n+1][(1<<22]={};
      |              ~     ^
      |                    )
a.cc:25:24: error: expected ']' before ';' token
   25 |   ll dp[n+1][(1<<22]={};
      |                        ^
      |                        ]
a.cc:32:3: error: 'dp' was not declared in this scope; did you mean 'dup'?
   32 |   dp[0][0]=1;
      |   ^~
      |   dup
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define FAST()                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0);
#define fill(a, i) memset(a, i, sizeof(a))
#define all(vec) vec.begin(),vec.end()
#define revall(vec) vec.rbegin(),vec.rend()
#define vl vector<ll>
#define tlll tuple<ll, ll, ll>
#define pb push_back
#define fr(i, a, b) for (int i = a; i < b; ++i)  
ll mod=1e9+7;
const ll maxn=1e5+5;
vl adj[maxn]; 
ll dp[maxn][2];
ll n;
bool visited[maxn];
FAST();
ll dfs(ll u,ll p,ll idx)
{ 
    if(visited[u])
    { 
        ll ans = idx==1?dp[u][0]:dp[u][1]+dp[u][0]; 
        return ans%mod;
    }
    visited[u]=1;
    fr(k,0,2)
    {
        ll temp=1;
        fr(i,0,adj[u].size())
        {
            if(adj[u][i]!=p) 
            temp=(temp*dfs(adj[u][i],u,k))%mod;
            
        } 
        dp[u][k]=temp;
    }
    ll ans = idx==1?dp[u][0]:dp[u][1]+dp[u][0] ; 
    return ans%mod;
}
void solve()
{
    cin>>n;
    fr(i,0,n-1)
    {
        ll u,v;
        cin>>u>>v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    ll ans=0;
    fr(k,0,2)
    {
        ll temp=1;
        temp=dfs(1,0,k); 
    } 
    cout<<(dp[1][0]+dp[1][1])%mod;
}
int main()
{
    ll t=1;
    // cin>>t;
    while(t--)
    solve();
}

Compiler output:
a.cc:6:30: error: expected constructor, destructor, or type conversion before '(' token
    6 |     ios_base::sync_with_stdio(false); \
      |                              ^
a.cc:22:1: note: in expansion of macro 'FAST'
   22 | FAST();
      | ^~~~
a.cc:7:5: error: 'cin' does not name a type
    7 |     cin.tie(0);                       \
      |     ^~~
a.cc:22:1: note: in expansion of macro 'FAST'
   22 | FAST();
      | ^~~~
a.cc:8:5: error: 'cout' does not name a type
    8 |     cout.tie(0);
      |     ^~~~
a.cc:22:1: note: in expansion of macro 'FAST'
   22 | FAST();
      | ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
long int mod 1000000007;
bool visited[100000+10]=false;
long int ans_b[100000+10];
long int ans_w[100000+10];
vector<long int> tree[100000+10];

vector<long int> dfs(long int u)
{
  visited[u]=true;
  long int b=1,w=1;
  for(long int i:tree[u])
  {
    if(!visited[i])
    {
      vector<long int> x=dfs(i);
      b=(b*x[1])%mod;
      w=(w*(x[0]+x[1])%mod)%mod;
    }
  }
  vector<long int> k;
  k.push_back(b);
  k.push_back(w);
  return k;
}

int main()
{
	long int n;
  	cin>>n;
  memset(ans_b,-1,sizeof ans_b);
  memset(ans_w,-1,sizeof ans_w);
  for(long int i=1;i<n;i++)
  {
  	long int u,v;
    cin>>u>>v;
    tree[u].push_back(v);
    tree[v].push_back(u);
  }
  vector<long int> k=dfs(1);
  cout<<(k[0]+k[1])%mod<<endl;
}

Compiler output:
a.cc:3:14: error: expected initializer before numeric constant
    3 | long int mod 1000000007;
      |              ^~~~~~~~~~
a.cc:4:25: error: array must be initialized with a brace-enclosed initializer
    4 | bool visited[100000+10]=false;
      |                         ^~~~~
a.cc: In function 'std::vector<long int> dfs(long int)':
a.cc:18:18: error: 'mod' was not declared in this scope; did you mean 'modf'?
   18 |       b=(b*x[1])%mod;
      |                  ^~~
      |                  modf
a.cc: In function 'int main()':
a.cc:42:21: error: 'mod' was not declared in this scope; did you mean 'modf'?
   42 |   cout<<(k[0]+k[1])%mod<<endl;
      |                     ^~~
      |                     modf
Language: C++

#include<bits/stdc++.h>
#define int long long 
using namespace std;
const int MOD=1e9+7;
vector<int> white,black;
vector< vector<int> > adj;
void dfs(int curr, int prev)
{
  for(int i=0;i<adj[curr].size();i++)
  { int u=adj[curr][i];
    if(u!=prev)
	dfs(u,curr);	
  }
  white[curr]=1;black[curr]=1;
  for(int i=0;i<adj[curr].size();i++)
  { int u=adj[curr][i];
  	if(u!=prev)
  	{
  	 	white[curr]=(white[curr]*((white[u]+black[u])%MOD))%MOD;
  	 	black[curr]=(black[curr]*white[u])%MOD;
	}
  }
}
//This is a program to compute the painters partition problem;
int main()
{
 int n;cin>>n;
 adj.resize(n+1);white.resize(n+1);black.resize(n+1);
 for(int i=1;i<n;i++)
 {
 	int x,y;cin>>x>>y;
 	adj[x].push_back(y);
 	adj[y].push_back(x);
 }
 dfs(1,0);
 cout<<(white[1]+black[1])%MOD<<endl;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include "bits/stdc++.h"
using namespace std;

#define rep(i, a, b) for(int i=a; i<=b; i++)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define pb push_back
#define MOD 1000000007	
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, u, v;
int par[100001];
vi adj[100001];
int mx=2;
int dp[100001][2];

//0 white 1 black
calc(int x, int c){
	if(adj[x].empty()) return 1;
	if(dp[x][c]!=-1) return dp[x][c];
	int ans=1;
	trav(k, adj[x]){
		if(k==par[x]) continue;
		par[k]=x;
		if(!c) ans=(ans*(calc(k, 0)%MOD+calc(k, 1)%MOD))%MOD;
		else ans=(ans*calc(k, 0)%MOD)%MOD;
	}
	return dp[x][c]=ans;
}

int main(){
  // freopen("input.txt", "r", stdin); 
  // freopen("output.txt", "w", stdout);
  cin.sync_with_stdio(0); cin.tie();
  cin.exceptions(cin.failbit);

  cin >> n;
  rep(i, 1, n-1){
  	cin >> u >> v;
  	adj[u].pb(v);
  	adj[v].pb(u);
  }

  rep(i, 1, n){
  	rep(j, 0, 1){
  		dp[i][j]=-1;
  	}
  }
  cout << calc(1, 0)+calc(1, 1);
}

Compiler output:
a.cc:21:1: error: ISO C++ forbids declaration of 'calc' with no type [-fpermissive]
   21 | calc(int x, int c){
      | ^~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;

#define rep(i, a, b) for(int i=a; i<=b; i++)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define pb push_back
#define MOD 1000000007	
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, u, v;
int par[100001];
vi adj[100001];
int mx=2;
int dp[100001][2];

//0 white 1 black
calc(int x, int col){
	if(adj[x].empty()) return 1;
	if(dp[x][col]!=-1) return dp[x][col];
	int ans=1;
	trav(k, adj[x]){
		if(k==par[x]) continue;
		par[k]=x;
		if(!col) ans=(ans*(calc(k, 0)%MOD+calc(k, 1)%MOD))%MOD;
		else ans=(ans*calc(k, 0)%MOD)%MOD;
	}
	return dp[x][col]=ans;
}

int main(){
  // freopen("input.txt", "r", stdin); 
  // freopen("output.txt", "w", stdout);
  cin.sync_with_stdio(0); cin.tie();
  cin.exceptions(cin.failbit);

  cin >> n;
  rep(i, 1, n-1){
  	cin >> u >> v;
  	adj[u].pb(v);
  	adj[v].pb(u);
  }

  rep(i, 1, n){
  	rep(j, 0, 1){
  		dp[i][j]=-1;
  	}
  }
  cout << calc(1, 0)+calc(1, 1);
}

Compiler output:
a.cc:21:1: error: ISO C++ forbids declaration of 'calc' with no type [-fpermissive]
   21 | calc(int x, int col){
      | ^~~~
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;

// https://cses.fi/problemset/task/1130
public class CSESTreeMatching {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter writer = new PrintWriter(System.out);

        int n = Integer.parseInt(reader.readLine());
        Map<Integer, Set<Integer>> edges = new HashMap<>();
        for (int i = 0; i < n; i++) {
            edges.put(i, new HashSet<>());
        }
        // n - 1 edges in a tree of n nodes
        for (int i = 0; i < n - 1; i++) {
            StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
            int a = Integer.parseInt(tokenizer.nextToken()) - 1;
            int b = Integer.parseInt(tokenizer.nextToken()) - 1;
            edges.get(a).add(b);
            edges.get(b).add(a);
        }
        int[] on = new int[n];
        int[] off = new int[n];
        dfs(edges, 0, -1, on, off);
        writer.println(Math.max(on[0], off[0]));
        reader.close();
        writer.close();
    }
    public static void dfs(Map<Integer, Set<Integer>> edges, int current, int parent, int[] on, int[] off) {
        for (int neighbor : edges.get(current)) {
            // don't go backwards
            if (neighbor == parent) {
                continue;
            }
            dfs(edges, neighbor, current, on, off);
            // update dp
            off[current] += Math.max(on[neighbor], off[neighbor]);
        }
        for (int neighbor : edges.get(current)) {
            // don't go backwards
            if (neighbor == parent) {
                continue;
            }
            on[current] = Math.max(on[current], off[neighbor] + 1 + off[current] - Math.max(on[neighbor], off[neighbor]));
        }
    }
}


Compiler output:
Main.java:11: error: class CSESTreeMatching is public, should be declared in a file named CSESTreeMatching.java
public class CSESTreeMatching {
       ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const int N=1e5+10;
const int mod=1e9+7;
const int inf=1e9;

ll dp[N][2];
bool vis[N];
vector<int> g[N];

void dfs(int u){
    if(vis[u]) return;
    vis[u]=true;
    dp[u][0]=1;
    dp[u][1]=1;
    for(auto v : g[u]){
        if(vis[v]) continue;
        dfs(v);
        dp[u][0]=(dp[u][0]*(dp[v][0] + dp[v][1]))%mod;
        dp[u][1]=(dp[u][1]*dp[v][0])%mod;
    }
}

int main(){
    int n;
    cin>>n;
    int a,b;
    for(int i=0;i<n-1;i++){
        cin>>a>>b;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    dfs(1);
    ll ans=(dp[1][0] + dp[1][1])%mod
    cout<<ans<<'\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:5: error: expected ',' or ';' before 'cout'
   36 |     cout<<ans<<'\n';
      |     ^~~~
Language: C


#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>

using namespace std;

constexpr int MOD = 1e9 + 7;

vector<vector<int>> tree;
vector<vector<int>> dp; 

size_t solution(int v, int p, bool black)
{
  if (dp[v][black] != -1) 
  {
    return dp[v][black];
  }
  auto& nodes = tree[v];
  size_t res = 1;
  for (auto n : nodes)
  { 
    if (n == p) continue;
    if (black)
    {   
      res *= solution(n, v, !black);
      res %= MOD;
    }   
    else
    {   
      res *= (solution(n, v, !black) + solution(n, v, black)) % MOD;
      res %= MOD;
    }
  }
  dp[v][black] = res;
  return res;
}

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int N;
  cin >> N;

  tree = vector<vector<int>>(N+1);
  dp = vector<vector<int>>(N+1, vector<int>(2, -1));

  for (int i = 0; i < N-1; ++i)
  {
    int x, y;
    cin >> x >> y;
    tree[x].push_back(y);
    tree[y].push_back(x);
  }

  cout << solution(1, 0, true) + solution(1, 0, false) << endl;

  return 0;
}

Compiler output:
main.c:2:10: fatal error: iostream: No such file or directory
    2 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#define ll long long
using namespace std;

int n,a,b;
vector<int> V[100005];
const ll MOD=1000000007;
int bio[100005];
ll dpW[100005];
ll dpB[100005];


pair<ll,ll> dfs (int a) {
    dpW[a]=1;
    dpB[a]=1;
    for (int b : V[a]) {
        if (bio[b]==1) {continue;}
        bio[b]=1;
        pair<ll,ll> ans=dfs(b);
        dpW[a]*=(ans.first+ans.second);
        dpB[a]*=ans.first;
        dpW[a]%=MOD;
        dpB[a]%=MOD;
    }
    if (dpW[a]==0) {dpW[a]++;}
    return {dpW[a],dpB[a]};

}

int main() {
    cin >> n;
    for (int i=0;i<n-1;i++) {
        cin >> a >> b;
        V[a].push_back(b);
        V[b].push_back(a);
    }

    bio[1]=1;
    dfs(1);
    cout << (dpW[1]+dpB[1])%MOD << endl;

}


Compiler output:
a.cc:5:1: error: 'vector' does not name a type
    5 | vector<int> V[100005];
      | ^~~~~~
a.cc:12:1: error: 'pair' does not name a type
   12 | pair<ll,ll> dfs (int a) {
      | ^~~~
a.cc: In function 'int main()':
a.cc:30:5: error: 'cin' was not declared in this scope
   30 |     cin >> n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define ll long long
a.cc:33:9: error: 'V' was not declared in this scope
   33 |         V[a].push_back(b);
      |         ^
a.cc:38:5: error: 'dfs' was not declared in this scope
   38 |     dfs(1);
      |     ^~~
a.cc:39:5: error: 'cout' was not declared in this scope
   39 |     cout << (dpW[1]+dpB[1])%MOD << endl;
      |     ^~~~
a.cc:39:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:39:36: error: 'endl' was not declared in this scope
   39 |     cout << (dpW[1]+dpB[1])%MOD << endl;
      |                                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define ll long long
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int mod=1e9 + 7;

int ans=2;

void dfs(int p,int& x,vector<vector<int>>& adj,vector<vector<int>>& dp)
{
		dp[x][0]=dp[x][1]=1;
	
		for(int i=0;i<adj[x].size();i++)
		{
			// cout<<x<<adj[x].size()<<endl;
			if(adj[x][i]==p)
				continue;
			dfs(x,adj[x][i],adj,dp);
			dp[x][1]=(dp[x][1]*dp[adj[x][i]][0])%mod;
			dp[x][0]=(dp[x][0]*(dp[adj[x][i]][0]+dp[adj[x][i]][1]))%mod;
			ans=max(ans,(dp[x][1]+dp[x][0])%mod);
		}
}


int main()
{
	
	int n;
	cin>>n;
	int x,y;
	vector<vector<int>>adj(n+1);
	vector<vector<int>>dp;    // 0 white 1 black
	

	for(int i=0;i<=n+1;i++)
		dp.push_back({0,0});

	for(int i=0;i<n-1;i++)
	{
		cin>>x>>y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}

	

	for(int i=1;i<n;i++)
		if(!vis[i])
			dfs(-1,i,adj,dp);
	
	
	cout<<ans;
}
	




Compiler output:
a.cc: In function 'int main()':
a.cc:48:21: error: 'vis' was not declared in this scope
   48 |                 if(!vis[i])
      |                     ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define vl vector<long long int>
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define all(x) x.begin(),x.end()
#define vi vector<int>
#define vb vector<bool>
#define vvl vector<vector<ll> >
#define vvi vector<vector<int> >
#define pl pair<ll,ll>
#define pb push_back
#define PI 3.14159265
#define mod 1e9+7
#define pb push_back
#define mp make_pair
#define fri(s,n) for(int i=s;i<n;i++)
#define frj(s,n) for(int j=s;j<n;j++)
#define T(i) int i=1;cin>>i;while(i--)
#define vsi vector<set<int> >
#define pii pair<int,int>
#define inf 1e9
#define vpii vector<pair<int,int> >


ll power(ll a,ll b){
    if(b==0)
        return 1;
    if(b&1)
        return a*power(a,b-1);
    ll temp=power(a,b/2);
    return temp*temp;
    }
bool mycompare(ll a,ll b){
    return a>b;
    }
ll dp[100005][2];
vector<vector<int> > graph;
void solve(vector<vector<int> >& graph,int parent,int node){
    dp[node][0]=dp[node][1]=1;
  	for(auto nbr:graph[node]){
      	if(nbr!=parent){
                solve(graph,node,nbr);
                dp[node][1]=dp[node][1]*((dp[nbr][0]+dp[nbr][1])%mod)%mod;
                dp[node][0]=dp[node][0]*dp[nbr][1]%mod;
    }}
    return;
}

int main(){
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
  	int n;
  	cin>>n;
  	memset(dp,0,sizeof dp);
    graph.resize(n+1);
  	for(int i=0;i<n-1;i++){
      	int x,y;
      	cin>>x>>y;
    	graph[x].push_back(y);
      	graph[y].push_back(x);
    }
  	solve(graph,-1,1);
  	cout<<(dp[1][0]+dp[1][1])%mod;

	}



Compiler output:
a.cc: In function 'void solve(std::vector<std::vector<int> >&, int, int)':
a.cc:44:65: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   44 |                 dp[node][1]=dp[node][1]*((dp[nbr][0]+dp[nbr][1])%mod)%mod;
      |                                          ~~~~~~~~~~~~~~~~~~~~~~~^
      |                                                     |
      |                                                     long long int
a.cc:45:51: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   45 |                 dp[node][0]=dp[node][0]*dp[nbr][1]%mod;
      |                             ~~~~~~~~~~~~~~~~~~~~~~^
      |                                        |
      |                                        long long int
a.cc: In function 'int main()':
a.cc:64:34: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   64 |         cout<<(dp[1][0]+dp[1][1])%mod;
      |               ~~~~~~~~~~~~~~~~~~~^
      |                        |
      |                        long long int
Language: C++

#include<bits/stdc++.h>
using namespace std;
int nax=1e5+5;
vector<int> edge[nax];
int mod=1e9+7;
int mul(int a,int b)
{
    return (ll) a*b%mod;
}
pair<int,int> dfs(int a,int parent)
{
    int white=1;
    int black=0;
    for(auto x: edge[a])
    {
        if(x!=parent)
        {
            pair<int,int> p=dfs(x,a);
            old_white=white;
            white=mul(white,p.second);
            black=(mul(old_white,p.first)+mul(black,p.first+p.second))%mod;
        }
    }
    return make_pair(white,(white+black)%mod);
}
int  main()
{
    int n;
    cin>>n;
    for(int i=0;i<n-1;i++)
    {
        int a,b;
        cin>>a>>b;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }
    pair<int,int> ans=dfs(1,-1);
    cout<<(ans.first+ans.second)%mod<<endl;
}

Compiler output:
a.cc:4:18: error: size of array 'edge' is not an integral constant-expression
    4 | vector<int> edge[nax];
      |                  ^~~
a.cc: In function 'int mul(int, int)':
a.cc:8:13: error: 'll' was not declared in this scope
    8 |     return (ll) a*b%mod;
      |             ^~
a.cc:8:16: error: expected ';' before 'a'
    8 |     return (ll) a*b%mod;
      |                ^~
      |                ;
a.cc: In function 'std::pair<int, int> dfs(int, int)':
a.cc:19:13: error: 'old_white' was not declared in this scope
   19 |             old_white=white;
      |             ^~~~~~~~~
Language: C++

##include<bits/stdc++.h>
using namespace std;

long long mod = 1e9 + 7; 
pair<int,int> dfs(int node,vector<bool> &vis,vector<vector<int>> &adj)
{
    vis[node] = true;
    int all_whites = 1;
    int black = 0;
    for(int a : adj[node])
    {
        pair<int,int> tmp;
        if(!vis[a])
        {
            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<int>> 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:1:1: error: stray '##' in program
    1 | ##include<bits/stdc++.h>
      | ^~
a.cc:1:3: error: 'include' does not name a type
    1 | ##include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:5:1: error: 'pair' does not name a type
    5 | pair<int,int> dfs(int node,vector<bool> &vis,vector<vector<int>> &adj)
      | ^~~~
a.cc: In function 'int main()':
a.cc:27:5: error: 'cin' was not declared in this scope
   27 |     cin >> n;
      |     ^~~
a.cc:28:5: error: 'vector' was not declared in this scope
   28 |     vector<vector<int>> adj(n+1);
      |     ^~~~~~
a.cc:28:19: error: expected primary-expression before 'int'
   28 |     vector<vector<int>> adj(n+1);
      |                   ^~~
a.cc:29:12: error: expected primary-expression before 'bool'
   29 |     vector<bool> vis(n+1);
      |            ^~~~
a.cc:34:9: error: 'adj' was not declared in this scope
   34 |         adj[u].push_back(v);
      |         ^~~
a.cc:37:22: error: 'vis' was not declared in this scope
   37 |     auto tmp = dfs(1,vis,adj);
      |                      ^~~
a.cc:37:26: error: 'adj' was not declared in this scope
   37 |     auto tmp = dfs(1,vis,adj);
      |                          ^~~
a.cc:37:16: error: 'dfs' was not declared in this scope
   37 |     auto tmp = dfs(1,vis,adj);
      |                ^~~
a.cc:38:5: error: 'cout' was not declared in this scope
   38 |     cout << (tmp.first + tmp.second)%mod << endl;
      |     ^~~~
a.cc:38:45: error: 'endl' was not declared in this scope
   38 |     cout << (tmp.first + tmp.second)%mod << endl;
      |                                             ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

//#define int long long int
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define lb lower_bound
#define ub upper_bound
#define srt(a) sort(a.begin(),a.end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
#define mxe(a) *max_element(a.begin(),a.end())
#define mne(a) *min_element(a.begin(),a.end())
#define endl '\n'
#define mod 1000000007
#define INF64 1e18
const int N=100005;
vi g[N];
vi black(N,1),white(N,1);
vector<int> visit(N,0);
void dfs(int u){
  visit[u]=1;
  for(int v:g[u]){
    if(visit[v]==0){
      dfs(v);
      black[u]*=white[v];
      black[u]%=mod;
      white[u]*=(white[v]+black[v]);
      white[u]%=mod;
    }
  }
  return;
}
void solve(){
  int n ;cin>>n;
  for(int i=1;i<n;i++){
    int x,y;cin>>x>>y;
    g[x].pb(y);
    g[y].pb(x);
  }
  dfs(1);
  cout<<(white[1]+black[1])%mod;
}

int32_t main(){
  #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
  #endif
  
  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);

  int T=1;
  //cin>>T;
  for(int TT=1;TT<=T;TT++){
    solve();
  }
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:27:3: error: reference to 'visit' is ambiguous
   27 |   visit[u]=1;
      |   ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:25:13: note:                 'std::vector<int> visit'
   25 | vector<int> visit(N,0);
      |             ^~~~~
a.cc:29:8: error: reference to 'visit' is ambiguous
   29 |     if(visit[v]==0){
      |        ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:25:13: note:                 'std::vector<int> visit'
   25 | vector<int> visit(N,0);
      |             ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

//#define int long long int
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define lb lower_bound
#define ub upper_bound
#define srt(a) sort(a.begin(),a.end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
#define mxe(a) *max_element(a.begin(),a.end())
#define mne(a) *min_element(a.begin(),a.end())
#define endl '\n'
#define mod 1000000007
#define INF64 1e18
const int N=100005;
vi g[N];
vi black(N,1),white(N,1);
vector<int> visit(N,0);
void dfs(int u){
  visit[u]=1;
  for(int v:g[u]){
    if(!visit[v]){
      
      dfs(v);
      black[u]*=white[v];
      black[u]%=mod;
      white[u]*=(white[v]+black[v]);
      white[u]%=mod;
    }
  }
  return;
}
void solve(){
  int n ;cin>>n;
  for(int i=1;i<n;i++){
    int x,y;cin>>x>>y;
    g[x].pb(y);
    g[y].pb(x);
  }
  dfs(1);
  cout<<(white[1]+black[1])%mod;
}

int32_t main(){
  #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
  #endif
  
  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);

  int T=1;
  //cin>>T;
  for(int TT=1;TT<=T;TT++){
    solve();
  }
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:27:3: error: reference to 'visit' is ambiguous
   27 |   visit[u]=1;
      |   ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:25:13: note:                 'std::vector<int> visit'
   25 | vector<int> visit(N,0);
      |             ^~~~~
a.cc:29:9: error: reference to 'visit' is ambiguous
   29 |     if(!visit[v]){
      |         ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:25:13: note:                 'std::vector<int> visit'
   25 | vector<int> visit(N,0);
      |             ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

//#define int long long int
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define lb lower_bound
#define ub upper_bound
#define srt(a) sort(a.begin(),a.end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
#define mxe(a) *max_element(a.begin(),a.end())
#define mne(a) *min_element(a.begin(),a.end())
#define endl '\n'
#define mod 1000000007
#define INF64 1e18
const int N=100005;
vi g[N];
vi black(N,1),white(N,1);
vector<bool> visit(N,0);
void dfs(int u){
  visit[u]=true;
  for(int v:g[u]){
    if(!visit[v]){
      
      dfs(v);
      black[u]*=white[v];
      black[u]%=mod;
      white[u]*=(white[v]+black[v]);
      white[u]%=mod;
    }
  }
  return;
}
void solve(){
  int n ;cin>>n;
  for(int i=1;i<n;i++){
    int x,y;cin>>x>>y;
    g[x].pb(y);
    g[y].pb(x);
  }
  dfs(1);
  cout<<(white[1]+black[1])%mod;
}

int32_t main(){
  #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
  #endif
  
  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);

  int T=1;
  //cin>>T;
  for(int TT=1;TT<=T;TT++){
    solve();
  }
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:27:3: error: reference to 'visit' is ambiguous
   27 |   visit[u]=true;
      |   ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:25:14: note:                 'std::vector<bool> visit'
   25 | vector<bool> visit(N,0);
      |              ^~~~~
a.cc:29:9: error: reference to 'visit' is ambiguous
   29 |     if(!visit[v]){
      |         ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:25:14: note:                 'std::vector<bool> visit'
   25 | vector<bool> visit(N,0);
      |              ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

#define int long long int
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define lb lower_bound
#define ub upper_bound
#define srt(a) sort(a.begin(),a.end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
#define mxe(a) *max_element(a.begin(),a.end())
#define mne(a) *min_element(a.begin(),a.end())
#define endl '\n'
#define mod 1000000007
#define INF64 1e18
const int N=100005;
vi g[N];
vi black(N,1),white(N,1);
vector<bool> visit(N,0);
void dfs(int u){
  visit[u]=1;
  for(int v:g[u]){
    if(!visit[v]){
      
      dfs(v);
      black[u]*=white[v];
      black[u]%=mod;
      white[u]*=(white[v]+black[v]);
      white[u]%=mod;
    }
  }
  return;
}
void solve(){
  int n ;cin>>n;
  for(int i=1;i<n;i++){
    int x,y;cin>>x>>y;
    g[x].pb(y);
    g[y].pb(x);
  }
  dfs(1);
  cout<<(white[1]+black[1])%mod;
}

int32_t main(){
  #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
  #endif
  
  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);

  int T=1;
  //cin>>T;
  for(int TT=1;TT<=T;TT++){
    solve();
  }
}

Compiler output:
a.cc: In function 'void dfs(long long int)':
a.cc:27:3: error: reference to 'visit' is ambiguous
   27 |   visit[u]=1;
      |   ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:25:14: note:                 'std::vector<bool> visit'
   25 | vector<bool> visit(N,0);
      |              ^~~~~
a.cc:29:9: error: reference to 'visit' is ambiguous
   29 |     if(!visit[v]){
      |         ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:25:14: note:                 'std::vector<bool> visit'
   25 | vector<bool> visit(N,0);
      |              ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll mod=1e9+7;
vector<vector<ll>> gr(1e5+2);
vector<vector<ll>> dp(1e5+2,vector<ll>(2,-1));
ll solve(int node,bool x,int p)
{
  if(dp[node][x]!=-1)
  return dp[node][x];
  ll ans=1,ans2=1;
  if(gr[node].size()==1&&p==gr[node][0])
  return dp[node][x]=(x==0?2:1);
  for(int z: gr[node])
  {
    if(z==p)
    continue;
    if(x)
    ans=(ans*solve(z,0,node))%mod;
    else
    {
      ans=(ans*solve(z,0,node))%mod;
      ans2=(ans2*solve(z,1,node))%mod;
    }
  }
  if(x)
  return dp[node][x]=(ans%mod);

  return dp[node][x]=((ans+ans2)%mod);
} 
int main()
{
  int n;
  cin>>n;
  for(int i=1;i<n;i++)
  {
     int x,y;
     cin>>x>>y;
     v[x].push_back(y);
     v[y].push_back(x);
  }
  ll ans=(solve(1,1,-1)%mod+solve(1,0,-1)%mod)%mod;
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:6: error: 'v' was not declared in this scope
   39 |      v[x].push_back(y);
      |      ^
Language: C++

#include <iostream>
#include<vector>
using namespace std;
#define ll long long
ll mod=1000000009;
ll dp[100001][2];
vector<int> Tree[100001];
ll solve(int u,bool constarint ,int par)
{
    ll ans=0;
    ll w1=1;
    if(dp[u][constarint]!=-1)
    {
        return dp[u][constarint];
    }
    for(int child:Tree[u])
    {
        if(child!=par)
        {
            w1=(w1*solve(child,0,u))%mod;
        }
    }
    ans+=w1;
    if(!constarint)
    {
        ll w2=1;
        for(int child:Tree[u])
        {
            if(child!=par)
            {
                w2=(w2*solve(child,1,u));
            }
        }
        ans=ans+w2;
    }
    return dp[u][constarint]=ans;
}
int main() {
    int n;
    cin>>n;
    memset(dp,-1,sizeof dp);
    for(int i=0;i<n-1;i++)
    {
        int u,v;
        cin>>u>>v;
        Tree[u].push_back(v);
        Tree[v].push_back(u);
    }
    cout<<solve(1,0,-1);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:5: error: 'memset' was not declared in this scope
   41 |     memset(dp,-1,sizeof dp);
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<vector>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<bits/stdc++.h>

using namespace std;

void dfs(vector<vector<int>> &dp,vector<vector<int>> &adj,int i,int parent){
  dp[i][0] = 1;
  dp[i][1]=1;
  for(auto e: adj[i]){
    if(e == parent) continue;
    dfs(dp,adj,e,i);
    dp[i][1] = dp[i][1] * (dp[e][0]);
    dp[i][0] = dp[i][0]*(dp[e][0]*dp[e][1]);
  }
  return;
}

int main(){
  int n,a,b;
  cin >> n;
  vector<vector<int>> adj(n+1);
  for(int i=0;i<n;i++){
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  
  vector<vector<int>> dp(n+1,vector<int>(2,0));
  vector<int> parent(n+1,-1);
  dfs(dp,adj,parent);
  cout << dp[1][0] + dp[1][1] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: cannot convert 'std::vector<int>' to 'int'
   29 |   dfs(dp,adj,parent);
      |              ^~~~~~
      |              |
      |              std::vector<int>
a.cc:5:63: note:   initializing argument 3 of 'void dfs(std::vector<std::vector<int> >&, std::vector<std::vector<int> >&, int, int)'
    5 | void dfs(vector<vector<int>> &dp,vector<vector<int>> &adj,int i,int parent){
      |                                                           ~~~~^
Language: C++

#include<bits/stdc++.h>

using namespace std;

void dfs(vector<vector<int>> &dp,vector<vector<int>> &adj,int i,int parent){
  dp[i][0] = 1;
  dp[i][1]=1;
  for(auto e: adj[i]){
    if(e == parent) continue;
    dfs(dp,adj,e,i);
    dp[i][1] = dp[i][1] * (dp[e][0]);
    dp[i][0] = dp[i][0]*(dp[e][0]*dp[e][1]);
  }
  return;
}

int main(){
  int n;
  cin >> n;
  vector<vector<int>> adj(n+1);
  for(int i=0;i<n;i++){
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  
  vector<vector<int>> dp(n+1,vector<int>(2,0));
  vector<int> parent(n+1,-1);
  dfs(dp,1,parent);
  cout << dp[1][0] + dp[1][1] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:12: error: 'a' was not declared in this scope
   22 |     cin >> a >> b;
      |            ^
a.cc:22:17: error: 'b' was not declared in this scope
   22 |     cin >> a >> b;
      |                 ^
a.cc:29:10: error: invalid initialization of non-const reference of type 'std::vector<std::vector<int> >&' from an rvalue of type 'int'
   29 |   dfs(dp,1,parent);
      |          ^
a.cc:5:55: note: in passing argument 2 of 'void dfs(std::vector<std::vector<int> >&, std::vector<std::vector<int> >&, int, int)'
    5 | void dfs(vector<vector<int>> &dp,vector<vector<int>> &adj,int i,int parent){
      |                                  ~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll =long long;
vector<ll> adj[100005];
bool vis[100005];
ll dpw[100005];
ll dpb[100005];
const int mod=1000000007;
void DFS(ll x)
{
	vis[x]=1;
	ll i,n = adj[x].size();
	dpb[x] = dpw[x] = 1;
	for(int i=0;i<n;i++)
	{
		if(vis[adj[x][i]]==0)
		{
			DFS(adj[x][i]);
			dpb[x] = (dpb[x] * dpw[adj[x][i]] )mod;
			dpw[x] = ( dpw[x] * (dpw[adj[x][i]] + dpb[adj[x][i]])mod )mod;
		}
	}
}
 
int main()
{	
	ll n,i,j,x,y;
	cin>>n;
	for(int i=0;i<n-1;i++)
	{
		cin>>x>>y;
		adj[x].pb(y);
		adj[y].pb(x);
	}
	memset(vis,false,sizeof(vis));
	DFS(1);
	cout<<(dpb[1]+dpw[1])mod;
  return 0;
}

Compiler output:
a.cc: In function 'void DFS(ll)':
a.cc:19:60: error: expected ';' before 'mod'
   19 |                         dpb[x] = (dpb[x] * dpw[adj[x][i]] )mod;
      |                                                            ^~~
      |                                                            ;
a.cc:20:78: error: expected ')' before 'mod'
   20 |                         dpw[x] = ( dpw[x] * (dpw[adj[x][i]] + dpb[adj[x][i]])mod )mod;
      |                                  ~                                           ^~~
      |                                                                              )
a.cc: In function 'int main()':
a.cc:32:24: error: 'class std::vector<long long int>' has no member named 'pb'
   32 |                 adj[x].pb(y);
      |                        ^~
a.cc:33:24: error: 'class std::vector<long long int>' has no member named 'pb'
   33 |                 adj[y].pb(x);
      |                        ^~
a.cc:37:30: error: expected ';' before 'mod'
   37 |         cout<<(dpb[1]+dpw[1])mod;
      |                              ^~~
      |                              ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
const ll m=1e9+7;
const ll e=1e5+5;
vector<ll> edges[e];
vector<ll> black(e);
bool vis[e];
using ll=long long;
vector<ll> white(e);
void dfs(ll x)
{
    vis[x]=true;
    black[x]=1;
    white[x]=1;
    for(ll y:edges[x])
    {
        if(!vis[y])
        {
            dfs(y);
            black[x]=(black[x]*white[y])%m;
            white[x]=(white[x]*white[y]+white[x]*black[y])%m;
        }
    }
    
}
int main()
{
    ll n;
    cin>>n;
    for(ll i=0;i<n-1;i++)
    {
        ll a,b;
        cin>>a>>b;
        edges[a].push_back(b);
        edges[b].push_back(a);
    }
    dfs(1);
    cout<<(black[1]+white[1]);
    return 0;
}

Compiler output:
a.cc:3:7: error: 'll' does not name a type
    3 | const ll m=1e9+7;
      |       ^~
a.cc:4:7: error: 'll' does not name a type
    4 | const ll e=1e5+5;
      |       ^~
a.cc:5:8: error: 'll' was not declared in this scope
    5 | vector<ll> edges[e];
      |        ^~
a.cc:5:10: error: template argument 1 is invalid
    5 | vector<ll> edges[e];
      |          ^
a.cc:5:10: error: template argument 2 is invalid
a.cc:5:18: error: 'e' was not declared in this scope
    5 | vector<ll> edges[e];
      |                  ^
a.cc:6:8: error: 'll' was not declared in this scope
    6 | vector<ll> black(e);
      |        ^~
a.cc:6:10: error: template argument 1 is invalid
    6 | vector<ll> black(e);
      |          ^
a.cc:6:10: error: template argument 2 is invalid
a.cc:6:18: error: 'e' was not declared in this scope
    6 | vector<ll> black(e);
      |                  ^
a.cc:7:10: error: 'e' was not declared in this scope
    7 | bool vis[e];
      |          ^
a.cc:9:18: error: 'e' was not declared in this scope
    9 | vector<ll> white(e);
      |                  ^
a.cc: In function 'void dfs(ll)':
a.cc:12:5: error: 'vis' was not declared in this scope
   12 |     vis[x]=true;
      |     ^~~
a.cc:13:10: error: invalid types 'int[ll {aka long long int}]' for array subscript
   13 |     black[x]=1;
      |          ^
a.cc:15:14: error: 'edges' was not declared in this scope
   15 |     for(ll y:edges[x])
      |              ^~~~~
a.cc:20:18: error: invalid types 'int[ll {aka long long int}]' for array subscript
   20 |             black[x]=(black[x]*white[y])%m;
      |                  ^
a.cc:20:28: error: invalid types 'int[ll {aka long long int}]' for array subscript
   20 |             black[x]=(black[x]*white[y])%m;
      |                            ^
a.cc:20:42: error: 'm' was not declared in this scope
   20 |             black[x]=(black[x]*white[y])%m;
      |                                          ^
a.cc:21:55: error: invalid types 'int[ll {aka long long int}]' for array subscript
   21 |             white[x]=(white[x]*white[y]+white[x]*black[y])%m;
      |                                                       ^
a.cc: In function 'int main()':
a.cc:34:9: error: 'edges' was not declared in this scope
   34 |         edges[a].push_back(b);
      |         ^~~~~
a.cc:38:17: error: invalid types 'int[int]' for array subscript
   38 |     cout<<(black[1]+white[1]);
      |                 ^
Language: C++

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define ll long long
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define vul vector<ull>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi2d vector<vi >
#define vl2d vector<vl >
#define vpll vector<pll >

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rz resize
#define fr(i,n) for(i=0;i<(n);i++)
#define frr(i,n) for(i=(n-1);i>=0;i--)
#define fre(i,n) for(i=0;i<=(n);i++)
#define frre(i,n) for (i=(n);i>=0;i--)
#define frab(i,a,b) for(i=(a);i<(b);i++)
#define freab(i,a,b) for(i=(a);i<=(b);i++)
#define frrab(i,a,b) for(i=(b-1);i>=a;i--)
#define frreab(i,b,a) for(i=(b);i>=a;i--)

#define sz(a) int((a).size())
#define mset(a,b) (memset(a,b,sizeof(a)))
#define max3(a,b,c) (max((a),max((b),(c))))
#define min3(a,b,c) (min((c),min((a),(b))))
#define sumv(v) accumulate(all(v),ll(0))
#define productv(v) accumulate(all(v), ll(1), multiplies< ll >())
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
vector <ll> sprime;
vector<char> prime (1000000, true);
void sieve(ll n)
{
  //O(nloglogn) time
  sprime.pb(0);
  prime[0] = prime[1] = false;
  ll cnt = 0;
  for (ll i = 2; i <= n; ++i)
  {
    if (prime[i])
    {
      cnt++;
      sprime.pb(i);
      for (ll j = 2 * i; j <= n; j += i)
        prime[j] = false;
    }
  }
}
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll fastpowMOD(ll a, ll p, ll MOD) { if (p == 0) return 1; ll z = fastpowMOD(a, p / 2, MOD); z = (z * z) % MOD; if (p % 2) z = (z * a) % MOD; return z; }
ll fastpow(ll a, ll p) { if (p == 0) return 1; ll z = fastpow(a, p / 2); z = (z * z); if (p % 2) z = (z * a); return z; }

#define mod 1000000007
#define inf LLONG_MAX
#define minf LLONG_MIN
#define pi 3.14
#define ex 2.71

//*********************************************///
const int N = 1e5+5;
//int i,j;
ll dp[N][2];
vector<int>G[N];
//0 is black 1 is white
ll n;
int i;
void dfs(int v,int p)
{
  for(auto it:G[v])
  {
    if(it!=p)
    {
      dfs(it,v);
      dp[v][0]=(dp[v][0]*dp[it][1];
      dp[v][1]*=((dp[it][0]+dp[it][1])%mod);
      dp[v][0]%=mod;
      dp[v][1]%=mod;
    }
  }
}

void solve()
{
  cin>>n;
  fr(i,n-1)
  {
    ll x,y;
    cin>>x>>y;
    G[x].pb(y);
    G[y].pb(x);
  }
  fr(i,n+1)
    dp[i][0]=dp[i][1]=1;
  dfs(1,-1);
  cout<<dp[1][0]+dp[1][1]<<endl;
}

int main()
{
  fast;
  int z;
  //cin>>z;
  z=1;
  while(z--)
  {
    solve();
  }
  return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:84:35: error: expected ')' before ';' token
   84 |       dp[v][0]=(dp[v][0]*dp[it][1];
      |                ~                  ^
      |                                   )
Language: C

/*
 * FileName:     P_fix
 * CreatedDate:  2020-05-31 02:59:34 +0900
 * LastModified: 2020-05-31 17:33:01 +0900
 */

/*
 * f(x) : 根xを白く塗った時の組み合わせ
 * g(x) : 根xを黒く塗った時の組み合わせ
 */

#include <stdio.h>
#include <stdlib.h>
#define N 50001
#define dev 1000000007
int matrix[N*N];
long int F(int prev_f,int u,int n);
long int G(int prev_g,int u,int n);
long int F(int prev_f,int u,int n){
    long int f_sum=1;
    for(int v=1;v<n+1;v++){
        if(matrix[u*(n+1)+v]==1 && prev_f!=v){
            f_sum*=(F(u,v,n)+G(u,v,n));
        }
    }
//    printf("f(%d)=%ld\n",u,f_sum);
    return f_sum;
}
long int G(int prev_g,int u,int n){
    long int g_sum=1;
    for(int v=0;v<n+1;v++){
        if(matrix[u*(n+1)+v]==1 && prev_g!=v){
            g_sum*=F(u,v,n);
        }
    }
//    printf("g(%d)=%ld\n",u,g_sum);
    return g_sum;
}
int main(void){
    int n;scanf("%d",&n);
    for(int i=0;i<n-1;i++){
        int x,y;
        scanf("%d%d",&x,&y);
        matrix[x*(n+1)+y]=1;
        matrix[y*(n+1)+x]=1;
    }
    int prev_f=0,prev_g=0;
    printf("%ld\n",(F(prev_f,1,n)+G(prev_g,1,n))%dev);
    return 0;
}


Compiler output:
main.c:16:13: warning: integer overflow in expression of type 'int' results in '-1794867295' [-Woverflow]
   16 | int matrix[N*N];
      |             ^
main.c:16:5: error: size of array 'matrix' is negative
   16 | int matrix[N*N];
      |     ^~~~~~