Language: C++

    #include<bits/stdc++.h>
    using namespace std;
    #define Mod 1000000007
    #define int long long
    #define MN 400005
    int ksm(int a,int x){
    	LL ans=1,w=a;
    	while(x){
    		if(x&1)ans=ans*w%Mod;
    		w=w*w%Mod;
    		x>>=1;
    	}
    	return ans;
    }
    int n,bin[MN],fa[MN],siz[MN];
    LL f[3];
    vector<int>edge[MN];
    void dfs(int x){
    	siz[x]=1;
    	for(int i=0;i<edge[x].size();++i)
    		if(fa[x]!=edge[x][i]){
    			fa[edge[x][i]]=x;
    			dfs(edge[x][i]);
    			siz[x]+=siz[edge[x][i]];
    		}
    }
    signed main(){
    	scanf("%d",&n);
    	bin[0]=1;
    	for(int i=1;i<=n;++i)bin[i]=(bin[i-1]<<1)%Mod;
    	for(int i=1;i<n;++i){
    		int x,y;
    		scanf("%d%d",&x,&y);
    		edge[x].push_back(y);
    		edge[y].push_back(x);
    	}
    	dfs(1);
    	LL ans=0,inv2=ksm(2,Mod-2);
    	for(int x=1;x<=n;++x){
    		f[0]=1;f[1]=f[2]=0;
    		for(int i=0;i<edge[x].size();++i){
    			int v=edge[x][i],tmp;
    			if(fa[x]==v) tmp=bin[n-siz[x]];
    			else tmp=bin[siz[v]];
    			LL P=ksm(tmp,Mod-2);
    		//	cerr<<x<<" "<<v<<": "<<P<<endl;
    			f[2]+=f[1]*(1ll-P+Mod)%Mod;
    			f[1]=(f[1]*(P)%Mod+f[0]*(1ll-P+Mod))%Mod;
    			f[0]=f[0]*(P)%Mod;
    		}
    		(ans+=f[2]*inv2%Mod)%=Mod;
    //		cerr<<x<<": "<<f[2]<<endl;
    	}
    	printf("%lld\n",ans%Mod);
    	return 0;
    }

Compiler output:
a.cc: In function 'long long int ksm(long long int, long long int)':
a.cc:7:9: error: 'LL' was not declared in this scope
    7 |         LL ans=1,w=a;
      |         ^~
a.cc:9:24: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |                 if(x&1)ans=ans*w%Mod;
      |                        ^~~
      |                        abs
a.cc:9:32: error: 'w' was not declared in this scope
    9 |                 if(x&1)ans=ans*w%Mod;
      |                                ^
a.cc:10:17: error: 'w' was not declared in this scope
   10 |                 w=w*w%Mod;
      |                 ^
a.cc:13:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |         return ans;
      |                ^~~
      |                abs
a.cc: At global scope:
a.cc:16:5: error: 'LL' does not name a type
   16 |     LL f[3];
      |     ^~
a.cc: In function 'int main()':
a.cc:38:9: error: 'LL' was not declared in this scope
   38 |         LL ans=0,inv2=ksm(2,Mod-2);
      |         ^~
a.cc:40:17: error: 'f' was not declared in this scope
   40 |                 f[0]=1;f[1]=f[2]=0;
      |                 ^
a.cc:45:27: error: expected ';' before 'P'
   45 |                         LL P=ksm(tmp,Mod-2);
      |                           ^~
      |                           ;
a.cc:47:41: error: 'P' was not declared in this scope
   47 |                         f[2]+=f[1]*(1ll-P+Mod)%Mod;
      |                                         ^
a.cc:51:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
   51 |                 (ans+=f[2]*inv2%Mod)%=Mod;
      |                  ^~~
      |                  abs
a.cc:51:28: error: 'inv2' was not declared in this scope
   51 |                 (ans+=f[2]*inv2%Mod)%=Mod;
      |                            ^~~~
a.cc:54:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   54 |         printf("%lld\n",ans%Mod);
      |                         ^~~
      |                         abs