#include using namespace std; typedef long long T; const int mod = 13313; double PI=3.141592653589793; complex dft1[2100007]; //poczebne complex dft2[2100007]; //poczebne complex * dftn = dft1; //poczebne complex * dfts = dft2; //poczebne complex pom[2100007]; //do zwyklego complex a1[2100007]; //do dokladnego complex b1[2100007]; //do dokladnego complex a2[2100007]; //do dokladnego complex b2[2100007]; //do dokladnego double cosi[2100007]; //poczebne complex omega[2100007]; //poczebne inline int potenga(int v) { for (int i=1; 1; i<<=1) { if (i>=v) { return i; } } } inline void dft(int n, int kier) { int n2=n-1; int s=0; int p; int g; for (int i=2; i<=n; i<<=1) { swap(dftn, dfts); p=n/i; if (kier) { g=0; for (int j=0; j (cosi[i], cosi[(i+dod)&n2]); } vector brute_mul(const vector & a, const vector & b) { if(a.empty() || b.empty()) return vector{}; vector r(a.size() + b.size() - 1, 0); for(int i = 0; i < (int) a.size(); ++i) for(int j = 0; j < (int) b.size(); ++j) r[i+j] += a[i] * b[j]; for(auto & x : r) x %= mod; return r; } vector fft(vector jed, vector dwa) { int n1=potenga(jed.size()+dwa.size()); if(n1 < 500) return brute_mul(jed, dwa); licz_omegi(n1); for (int i=0; i<(int)jed.size(); i++) dftn[i]=jed[i]; for (int i=jed.size(); i ret; for (int i=0; i fft_dokladne(vector jed, vector dwa) { int n1=potenga(jed.size()+dwa.size()); licz_omegi(n1); long long M=32000; for (int i=0; i<(int)jed.size(); i++) dftn[i]=jed[i]/M; for (int i=jed.size(); i ret; for (int i=0; i solve(vector freq) { if(freq.size() == 1) return vector(freq[0] + 1, 1); vector a, b; for(int i = 0; i < (int) freq.size(); ++i) { if(i < (int) freq.size() / 2) a.push_back(freq[i]); else b.push_back(freq[i]); } return fft(solve(a), solve(b)); } void te() { int n, k; scanf("%d%d", &n, &k); for(int i = 0; i < n; ++i) scanf("%d", &t[i]); sort(t, t + n); vector freq; for(int i = 0; i < n; ++i) { int cnt = 1; while(i + 1 < n && t[i] == t[i+1]) { ++i; ++cnt; } freq.push_back(cnt); } printf("%d\n", (int) solve(freq)[k]); } int main() { te(); }