点击查看代码
#include<bits/stdc++.h>
using namespace std;
const int N=7e4,p=1e9+7;
int f[N];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin>>n;
	f[0]=1;
	for(int i=1;i<1<<n;++i)
	{
	  long long res=1;
	  for(int j=i;j;j=(j-1)&i)
	  res+=f[j];
	  f[i]=(res%p*i)%p;
	} 
	for(int i=0;i<1<<n;++i) cout<<f[i]<<' ';
}

 posted on 2023-10-07 10:08  ruoye123456  阅读(50)  评论(0)    收藏  举报