Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#define LL long long
#define RG register
using namespace std;
#define N 800000
inline int gi() {
	RG int w=0;
	RG bool q=1;
	RG char c=getchar();
	while ((c<'0'||c>'9') && c!='-') c=getchar();
	if (c=='-') q=0,c=getchar();
	while (c>='0'&&c <= '9') w=w*10+c-'0',c=getchar();
	return q? w:-w;
}
#define mod 924844033
int n,fac[N],inv[N];
int head[N],next[N<<1],to[N<<1],siz[N];
int ans[N],s[N];
int q[N],fa[N],pre[N];
#define dec(x,y) if (((x)-=(y))<0) (x)+=mod
inline int qpow(int x,int y) {
	int ans=1;
	while (y) {
		if (y&1) ans=1LL*ans*x%mod;
		x=1LL*x*x%mod;y>>=1;
	}
	return ans;
}
namespace NTT{
	int a[N],b[N],c[N],d[N],R[N],ans[N];
	struct C{ long double x,y; }A[N],B[N];
	inline C operator + (const C &a,const C &b) { return (C){a.x+b.x,a.y+b.y}; }
	inline C operator - (const C &a,const C &b) { return (C){a.x-b.x,a.y-b.y}; }
	inline C operator * (const C &a,const C &b) { return (C){a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x}; }
	const long double pi=acos(-1);
	inline void fft(int n,C *a,int f) {
		int i,k,o;C wn,w,x,y;
		for (i=0;i<n;i++) if (R[i]>i) swap(a[i],a[R[i]]);
		for (i=1;i<n;i<<=1) {
			wn=(C){cos(pi/i),sin(f*pi/i)};
			for (o=0;o<n;o+=i<<1) {
				w=(C){1,0};
				for (k=0;k<i;k++,w=w*wn) {
					x=a[o+k],y=a[o+k+i]*w;
					a[o+k]=x+y;
					a[o+k+i]=x-y;
				}
			}
		}
	}
	inline void work(int m) {
		int n,L=-1,i;LL x;
		for (n=1;n<=m<<1;n<<=1) L++;
		for (i=1;i<n;i++) R[i]=R[i>>1]>>1|(i&1)<<L;
		for (i=0;i<=m;i++) c[i]=a[i]&32767,a[i]>>=15,d[i]=b[i]&32767,b[i]>>=15;
		
		for (i=0;i<n;i++) A[i]=(C){(double)c[i],0},B[i]=(C){(double)d[i],0};
		fft(n,A,1);
		fft(n,B,1);
		for (i=0;i<n;i++) A[i]=A[i]*B[i];
		fft(n,A,-1);
		for (i=m<<1;i>m;i--) {
			x=A[i].x/n+0.5;
			ans[i]=(x%=mod);
			dec(ans[i],(x<<15)%mod);
		}
		for (i=0;i<n;i++) A[i]=(C){(double)a[i],0},B[i]=(C){(double)b[i],0};
		fft(n,A,1);
		fft(n,B,1);
		for (i=0;i<n;i++) A[i]=A[i]*B[i];
		fft(n,A,-1);
		for (i=m<<1;i>m;i--) {
			x=A[i].x/n+0.5;
			ans[i]=(ans[i]+(((x%mod)<<15%mod)<<15)-(x<<15))%mod;
		}
		
		for (i=0;i<n;i++) A[i]=(C){(double)a[i]+c[i],0},B[i]=(C){(double)b[i]+d[i],0};
		fft(n,A,1);
		fft(n,B,1);
		for (i=0;i<n;i++) A[i]=A[i]*B[i];
		fft(n,A,-1);
		for (i=m<<1;i>m;i--) {
			x=A[i].x/n+0.5;
			ans[i]=(ans[i]+((x%mod)<<15))%mod;
		}
	}
}
int main()
{
	int n=gi(),i,j,a,b,tot=0,l,r,k;
	for (i=1;i<n;i++) {
		a=gi(),b=gi();
		to[++tot]=b,next[tot]=head[a],head[a]=tot;
		to[++tot]=a,next[tot]=head[b],head[b]=tot;
	}
	for (i=fac[0]=1;i<=n;i++) fac[i]=1LL*fac[i-1]*i%mod;
	inv[n]=qpow(fac[n],mod-2);
	for (i=n;i;i--) inv[i-1]=1LL*inv[i]*i%mod;
	for (i=1;i<=n;i++) ans[i]=fac[n]*(inv[n-1-i]+1LL*inv[n-i]*i%mod)%mod;
	for (l=0,q[r=1]=1;l!=r;) for (i=head[k=q[++l]];i;i=next[i]) if (to[i]!=fa[k]) fa[q[++r]=to[i]]=k;
	for (s[i=n]--;i;i--) s[++siz[k=q[i]]]++,siz[fa[k]]+=siz[k],s[n-siz[k]]++;
    
	for (i=0,j=n;i<=n;i++,j--) NTT::b[i]=inv[j],NTT::a[i]=1LL*fac[i]*s[i]%mod;
	NTT::work(n);
	for (i=1;i<=n;i++) if ((ans[i]-=NTT::ans[i+n])<0) ans[i]+=mod;
	for (i=1;i<=n;i++) printf("%d\n",int(1LL*ans[i]*inv[i]%mod));
	return 0;
}


Compiler output:
a.cc: In function 'int gi()':
a.cc:11:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   11 |         RG int w=0;
      |                ^
a.cc:12:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |         RG bool q=1;
      |                 ^
a.cc:13:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   13 |         RG char c=getchar();
      |                 ^
a.cc: In function 'int main()':
a.cc:97:29: error: reference to 'next' is ambiguous
   97 |                 to[++tot]=b,next[tot]=head[a],head[a]=tot;
      |                             ^~~~
In file included from /usr/include/c++/14/string:47,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:21:13: note:                 'int next [1600000]'
   21 | int head[N],next[N<<1],to[N<<1],siz[N];
      |             ^~~~
a.cc:98:29: error: reference to 'next' is ambiguous
   98 |                 to[++tot]=a,next[tot]=head[b],head[b]=tot;
      |                             ^~~~
/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:21:13: note:                 'int next [1600000]'
   21 | int head[N],next[N<<1],to[N<<1],siz[N];
      |             ^~~~
a.cc:104:60: error: reference to 'next' is ambiguous
  104 |         for (l=0,q[r=1]=1;l!=r;) for (i=head[k=q[++l]];i;i=next[i]) if (to[i]!=fa[k]) fa[q[++r]=to[i]]=k;
      |                                                            ^~~~
/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:21:13: note:                 'int next [1600000]'
   21 | int head[N],next[N<<1],to[N<<1],siz[N];
      |             ^~~~