Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e6+10,p=924844033;
int inc(int x,int y){x+=y;return x>=p?x-p:x;}
int dec(int x,int y){x-=y;return x<0?x+p:x;}
int mul(int x,int y){return (ll)x*y%p;}
int power(int x,int y){
    int ans=1;
    for (;y;y>>=1,x=mul(x,x))
        if (y&1) ans=mul(ans,x);
    return ans;
}
int w[N],iw[N];
void init(int n){
    w[0]=1;w[1]=power(5,(p-1)/n);
    for (int i=2;i<=n;i++) w[i]=mul(w[i-1],w[1]);
    for (int i=0;i<=n;i++) iw[i]=w[n-i];
}
void fft(int n,int *a,int *w){
    for (int i=0,j=0;i<n;i++){
        if (i<j) swap(a[i],a[j]);
        for (int k=n>>1;(j^=k)<k;k>>=1);
    }
    for (int i=2;i<=n;i<<=1){
        int m=i>>1,step=n/i;
        for (int j=0;j<n;j+=i)
        for (int k=0,pos=0;k<m;k++,pos+=step){
            int t=mul(a[j+k+m],w[pos]);
            a[j+k+m]=dec(a[j+k],t);
            a[j+k]=inc(a[j+k],t);
        }
    }
    if (w==iw){
        int del=power(n,p-2);
        for (int i=0;i<n;i++) a[i]=mul(a[i],del);
    }
}
int n,e[N],head[N],next[N];
void add(int f,int t){
    static int cnt=0;
    e[++cnt]=t;
    next[cnt]=head[f];
    head[f]=cnt;
}
int size[N];
void dfs(int x,int fa){
    size[x]=1;
    for (int i=head[x];i;i=next[i]){
        int v=e[i];
        if (v==fa) continue;
        dfs(v,x);
        size[x]+=size[v];
    }
}
int cnt[N],fac[N],ifac[N],f[N],g[N];
int main()
{
    scanf("%d",&n);
    for (int i=1;i<n;i++){
        int u,v;
        scanf("%d%d",&u,&v);
        add(u,v);add(v,u);
    }
    dfs(1,0);
    cnt[n]=n;
    for (int i=2;i<=n;i++)
        cnt[size[i]]--,cnt[n-size[i]]--;
    for (int i=1;i<=n;i++)
        if (cnt[i]<0) cnt[i]+=p;
    fac[0]=1;
    for (int i=1;i<=n;i++) fac[i]=mul(fac[i-1],i);
    ifac[n]=power(fac[n],p-2);
    for (int i=n;i;i--) ifac[i-1]=mul(ifac[i],i);
    for (int i=0;i<=n;i++) g[i]=mul(cnt[i],fac[i]),f[i]=ifac[n-i];
    int size=1;
    while (size<=n+n) size<<=1;
    init(size);
    fft(size,f,w);fft(size,g,w);
    for (int i=0;i<size;i++) f[i]=mul(f[i],g[i]);
    fft(size,f,iw);
    for (int i=1;i<=n;i++) printf("%d\n",mul(f[i+n],ifac[i]));
    return 0;
}

Compiler output:
a.cc: In function 'void add(int, int)':
a.cc:43:5: error: reference to 'next' is ambiguous
   43 |     next[cnt]=head[f];
      |     ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:39:20: note:                 'int next [1000010]'
   39 | int n,e[N],head[N],next[N];
      |                    ^~~~
a.cc: In function 'void dfs(int, int)':
a.cc:48:5: error: reference to 'size' is ambiguous
   48 |     size[x]=1;
      |     ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:46:5: note:                 'int size [1000010]'
   46 | int size[N];
      |     ^~~~
a.cc:49:28: error: reference to 'next' is ambiguous
   49 |     for (int i=head[x];i;i=next[i]){
      |                            ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:39:20: note:                 'int next [1000010]'
   39 | int n,e[N],head[N],next[N];
      |                    ^~~~
a.cc:53:9: error: reference to 'size' is ambiguous
   53 |         size[x]+=size[v];
      |         ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:46:5: note:                 'int size [1000010]'
   46 | int size[N];
      |     ^~~~
a.cc:53:18: error: reference to 'size' is ambiguous
   53 |         size[x]+=size[v];
      |                  ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:46:5: note:                 'int size [1000010]'
   46 | int size[N];
      |     ^~~~
a.cc: In function 'int main()':
a.cc:68:13: error: reference to 'size' is ambiguous
   68 |         cnt[size[i]]--,cnt[n-size[i]]--;
      |             ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:46:5: note:                 'int size [1000010]'
   46 | int size[N];
      |     ^~~~
a.cc:68:30: error: reference to 'size' is ambiguous
   68 |         cnt[size[i]]--,cnt[n-size[i]]--;
      |                              ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:46:5: note:                 'int size [1000010]'
   46 | int size[N];
      |     ^~~~