Language: C++

#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007,N=200001;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

//階乗とか
ll fac[N],finv[N],inv[N];
void cominit(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<N;i++){
        fac[i]=fac[i-1]*i%mod;
        inv[i]=mod-inv[mod%i]*(mod/i)%mod;
        finv[i]=finv[i-1]*inv[i]%mod;
    }
}

vector<vector<ll> > g(N);
ll pa[N],dpin[N],dpout[N],inl[N],outl[N];//ans,line

//dp[now]=(SUM(line)!)*PI(dp[to]/(line!))
inline ll in(int n){return (dpin[n]*finv[inl[n]])%mod;}
inline ll out(int n){return (dpout[n]*finv[outl[n]])%mod;}


void dfs1(ll now,ll p){
	pa[now]=p;
	ll ans=1,sum=0;
	for(auto& to:g[now]){
		if(to==p)continue;
		dfs1(to,now);
		sum+=inl[to];
		(ans*=in(to))%=mod;
	}
	(ans*=fac[sum])%=mod;

	inl[now]=sum+1;
	dpin[now]=ans;
	return;
}

void dfs2(ll now,ll p){
	int niko=g[now].size();
	vector<ll> v1,v2,v3,v4;
  
  　//累積
	for(auto& to:g[now]){
		if(to==p)v1.pb(1),v2.pb(1),v3.pb(0),v4.pb(0);
		else{
			v1.pb(in(to));
			v2.pb(in(to));
			v3.pb(inl[to]);
			v4.pb(inl[to]);
		}
	}
    for(int i=1;i<niko;i++) (v1[i]*=v1[i-1])%=mod,v3[i]+=v3[i-1];
	for(int i=niko-2;i>=0;i--) (v2[i]*=v2[i+1])%=mod,v4[i]+=v4[i+1];
  　//out
	for(int i=0;i<niko;i++){
		int to=g[now][i];
		if(to==p) continue;
		ll ans=out(now),sum=outl[now];
		if(i>0) (ans*=v1[i-1])%=mod,sum+=v3[i-1];
		if(i<niko-1) (ans*=v2[i+1])%=mod,sum+=v4[i+1];
        (ans*=fac[sum])%=mod;
	    outl[to]=sum+1,dpout[to]=ans;
		dfs2(to,now);
	}
	return;
}

int main(){
	cin.tie(0);cout.tie(0);
	ios::sync_with_stdio(false);
  　cominit();
	ll n,a,b;
	cin>>n;
	for(int i=1;i<n;i++){
		cin>>a>>b;
		a--,b--;
		g[a].pb(b);
		g[b].pb(a);
	}

	dfs1(0,-1);

	dpout[0]=1;
	outl[0]=0;
	dfs2(0,-1);

	for(int i=0;i<n;i++){
		ll sum=outl[i],ans=out(i);//親
		for(auto& to:g[i]){
			if(to==pa[i])continue;
          　//子
			sum+=inl[to];
			(ans*=in(to))%=mod;
		}
		(ans*=fac[sum])%=mod;
		cout << ans << endl;
	}
	return 0;
}


Compiler output:
a.cc:50:3: error: extended character 　 is not valid in an identifier
   50 |   　//累積
      |   ^
a.cc:62:3: error: extended character 　 is not valid in an identifier
   62 |   　//out
      |   ^
a.cc:79:3: error: extended character 　 is not valid in an identifier
   79 |   　cominit();
      |   ^
a.cc:99:11: error: extended character 　 is not valid in an identifier
   99 |           　//子
      |           ^
a.cc: In function 'void dfs2(ll, ll)':
a.cc:50:3: error: '\U00003000' was not declared in this scope
   50 |   　//累積
      |   ^~
a.cc:62:5: error: expected ';' before 'for'
   62 |   　//out
      |     ^
      |     ;
   63 |         for(int i=0;i<niko;i++){
      |         ~~~
a.cc:63:21: error: 'i' was not declared in this scope
   63 |         for(int i=0;i<niko;i++){
      |                     ^
a.cc: In function 'int main()':
a.cc:79:3: error: '\U00003000cominit' was not declared in this scope; did you mean 'cominit'?
   79 |   　cominit();
      |   ^~~~~~~~~
      |   cominit
a.cc:99:11: error: '\U00003000' was not declared in this scope
   99 |           　//子
      |           ^~