Language: C++

#include<bits/stdc++.h>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;++A)
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
#define MOD (ll)(1e9+7)

struct llm{
    ll value=0;
    llm(const ll& val=0){this->value = (MOD + val % MOD) % MOD;}
    llm(const int& val){this->value = (MOD + val % MOD) % MOD;}
    llm(const llm& a) { llm(a.value); }
    llm inv(){ll a = 1;ll b = this->value;for(ll m=MOD-2;m>0;m/=2){if(m&1){a=a*b%MOD;}b=b*b%MOD;}return llm(a);}
    llm &operator+=(const llm &a) {this->value = (this->value + a.value) % MOD;return *this;}
    llm &operator-=(const llm &a) {this->value = (this->value - a.value + MOD) % MOD;return *this;}
    llm &operator*=(const llm &a) {this->value = (this->value * a.value) % MOD; return *this; }
    explicit operator ll() const{return (ll)value;}
    explicit operator int() const{return (int)value;}
};
llm operator+(const llm &a, const llm &b) { return llm(a.value + b.value); }
llm operator-(const llm &a, const llm &b) { return llm(a.value - b.value); }
llm operator*(const llm &a, const llm &b) { return llm(a.value * b.value); }
#define pllm pair<llm,llm>


llm Fa[202020];
void init(){
    ll i;
    Fa[0] = 1;
    fornum(i,0,201010){
        Fa[i + 1] = Fa[i] * (i + 1)%MOD;
    }
}




ll N;
vector<ll> abv[202020];
ll i, j, k;
pair<ll,llm> mk[202020];
llm anss[202020];
pair<ll,llm> dfs1(ll a,ll p){
    ll ret1 = 0;
    llm ret2 = 1;
    ll i;
    fornum(i,0,abv[a].size()){
        ll b = abv[a][i];
        if(b==p)
            continue;
        auto r = dfs1(b, a);
        ret1 += r.first;
        ret2 *= r.second * Fa[r.first].inv();
    }
    (ret2 *= Fa[ret1]) %= MOD;
    
    //printf("%lld ", (ll)ret2);
    return mk[a] = {ret1 + 1, ret2};
}
void dfs2(ll a,ll p,ll n,llm c){
    //printf("%lld,%lld,%lld,%lld\n", a, p, n, c);
    ll i;
    c *= Fa[n].inv();
    fornum(i,0,abv[a].size()){
        ll b = abv[a][i];
        if(b==p)
            continue;
        n += mk[b].first;
        c *= mk[b].second * Fa[mk[b].first].inv();
    }
    anss[a] = Fa[n] * c;
    
    fornum(i,0,abv[a].size()){
        ll b = abv[a][i];
        if(b==p)
            continue;
        dfs2(b, a,
             N - mk[b].first,
             c * Fa[n - mk[b].first] * Fa[mk[b].first] * mk[b].second);
    }
}



int main(){
    init();
    scanf("%lld", &N);
    fornum(i,1,N){
        ll a, b;
        scanf("%lld%lld", &a, &b);
        abv[a].push_back(b);
        abv[b].push_back(a);
    }
    dfs1(1,0);
    dfs2(1, 0, 0, 1);
    fornum(i,0,N){
        printf("%lld\n", (ll)anss[i+1]);
    }

    return 0;
}

Compiler output:
a.cc: In function 'void init()':
a.cc:36:36: error: no match for 'operator%' (operand types are 'llm' and 'long long int')
   36 |         Fa[i + 1] = Fa[i] * (i + 1)%MOD;
      |                     ~~~~~~~~~~~~~~~^
      |                           |
      |                           llm
a.cc:36:36: note: candidate: 'operator%(int, long long int)' (built-in)
   36 |         Fa[i + 1] = Fa[i] * (i + 1)%MOD;
      |                                    ^
a.cc:36:36: note:   no known conversion for argument 1 from 'llm' to 'int'
a.cc:36:36: note: candidate: 'operator%(long long int, long long int)' (built-in)
a.cc:36:36: note:   no known conversion for argument 1 from 'llm' to 'long long int'
In file included from /usr/include/c++/14/valarray:605,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
a.cc:11:23: note:   'llm' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   11 | #define MOD (ll)(1e9+7)
      |                       ^
a.cc:36:37: note: in expansion of macro 'MOD'
   36 |         Fa[i + 1] = Fa[i] * (i + 1)%MOD;
      |                                     ^~~
/usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
a.cc:11:23: note:   'llm' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   11 | #define MOD (ll)(1e9+7)
      |                       ^
a.cc:36:37: note: in expansion of macro 'MOD'
   36 |         Fa[i + 1] = Fa[i] * (i + 1)%MOD;
      |                                     ^~~
/usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
a.cc:11:23: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int'
   11 | #define MOD (ll)(1e9+7)
      |                       ^
a.cc:36:37: note: in expansion of macro 'MOD'
   36 |         Fa[i + 1] = Fa[i] * (i + 1)%MOD;
      |                                     ^~~
/usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
a.cc:11:23: note:   'llm' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   11 | #define MOD (ll)(1e9+7)
      |                       ^
a.cc:36:37: note: in expansion of macro 'MOD'
   36 |         Fa[i + 1] = Fa[i] * (i + 1)%MOD;
      |                                     ^~~
/usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
a.cc:11:23: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int'
   11 | #define MOD (ll)(1e9+7)
      |                       ^
a.cc:36:37: note: in expansion of macro 'MOD'
   36 |         Fa[i + 1] = Fa[i] * (i + 1)%MOD;
      |                                     ^~~
/usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const valarray<_Tp>&, const valarray<_Tp>&)'
 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1200:1: note:   template argument deduction/substitution failed:
a.cc:11:23: note:   'llm' is not derived from 'const std::valarray<_Tp>'
   11 | #define MOD (ll)(1e9+7)
      |                       ^
a.cc:36:37: note: in expansion of macro 'MOD'
   36 |         Fa[i + 1] = Fa[i] * (i + 1)%MOD;
      |                                     ^~~
/usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1200:1: note:   template argument deduction/substitution failed:
a.cc:11:23: note:   'llm' is not derived from 'const std::valarray<_Tp>'
   11 | #define MOD (ll)(1e9+7)
      |                       ^
a.cc:36:37: note: in expansion of macro 'MOD'
   36 |         Fa[i + 1] = Fa[i] * (i + 1)%MOD;
      |                                     ^~~
/usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)'
 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1200:1: note:   template argument deduction/substitution failed:
a.cc:11:23: note:   mismatched types 'const std::valarray<_Tp>' and 'long long int'
   11 | #define MOD (ll)(1e9+7)
      |                       ^
a.cc:36:37: note: in expansion of macro 'MOD'
   36 |         Fa[i + 1] = Fa[i] * (i + 1)%MOD;
      |                                     ^~~
a.cc: In function 'std::pair<long long int, llm> dfs1(long long int, long long int)':
a.cc:60:24: error: no match for 'operator%=' (operand types are 'llm' and 'long long int')
   60 |     (ret2 *= Fa[ret1]) %= MOD;
      |                        ^