题意:n个数字1-m,问取k个组成的set方案数
题解:假设某个数出现k次,那么生成函数为\(1+x+...+x^k\),那么假设第i个数出现ai次,结果就是\(\sum_{i=1}^m(1+x+...+x^{a_i})\),第k项即为答案,启发式合并fft即可
组合(即set):普通生成函数.排列:指数型生成函数
//#pragma GCC optimize(2)
//#pragma GCC optimize(3)
//#pragma GCC optimize(4)
//#pragma GCC optimize("unroll-loops")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include
//#include
#define fi first
#define se second
#define db double
#define mp make_pair
#define pb push_back
#define mt make_tuple
//#define pi acos(-1.0)
#define ll long long
#define vi vector
#define mod 1009
#define ld long double
//#define C 0.5772156649
#define ls l,m,rt<<1
#define rs m+1,r,rt<<1|1
#define pll pair
#define pil pair
#define pli pair
#define pii pair
#define ull unsigned long long
#define bpc __builtin_popcount
#define base 1000000000000000000ll
#define fin freopen("a.txt","r",stdin)
#define fout freopen("a.txt","w",stdout)
#define fio ios::sync_with_stdio(false);cin.tie(0)
#define mr mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
inline ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
inline void sub(ll &a,ll b){a-=b;if(a<0)a+=mod;}
inline void add(ll &a,ll b){a+=b;if(a>=mod)a-=mod;}
templateinline T const& MAX(T const &a,T const &b){return a>b?a:b;}
templateinline T const& MIN(T const &a,T const &b){return a>=1;}return ans;}
inline ll qp(ll a,ll b,ll c){ll ans=1;while(b){if(b&1)ans=mul(ans,a,c);a=mul(a,a,c),b>>=1;}return ans;}
using namespace std;
//using namespace __gnu_pbds;
const ld pi = acos(-1);
const ull ba=233;
const db eps=1e-5;
const ll INF=0x3f3f3f3f3f3f3f3f;
const int N=200000+10,maxn=2000000+10,inf=0x3f3f3f3f;
struct cd{
ld x,y;
cd(ld _x=0.0,ld _y=0.0):x(_x),y(_y){}
cd operator +(const cd &b)const{
return cd(x+b.x,y+b.y);
}
cd operator -(const cd &b)const{
return cd(x-b.x,y-b.y);
}
cd operator *(const cd &b)const{
return cd(x*b.x - y*b.y,x*b.y + y*b.x);
}
cd operator /(const db &b)const{
return cd(x/b,y/b);
}
}a[N<<3],b[N<<3];
int rev[N<<3];
void getrev(int bit)
{
for(int i=0;i<(1<>1]>>1) | ((i&1)<<(bit-1));
}
void fft(cd *a,int n,int dft)
{
for(int i=0;is;
int main()
{
int n,m,k;scanf("%d%d%d",&n,&m,&k);
for(int i=1,x;i<=n;i++)scanf("%d",&x),c[x]++;
for(int i=1;i<=m;i++)if(c[i])
{
info te;te.v.clear();te.id=i;
for(int j=0;j<=c[i];j++)te.v.pb(1);
s.insert(te);
}
while(s.size()>=2)
{
info x=*s.begin();s.erase(s.begin());
info y=*s.begin();s.erase(s.begin());
int p=x.v.size(),q=y.v.size();
int sz=0;
while((1<v[k]);
return 0;
}
/********************
********************/