题目链接:
$${Ans=\frac{\prod _{i=1}^{m}i}{w-n+1}}$$
1 #include2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 #define maxn 1001010 #define llg int11 #define md 998244353 12 #define yyj(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout);13 llg n,m,ans,x,w;14 15 inline int getint()16 {17 int w=0;18 char c=getchar();19 while((c<'0' || c>'9') && c!='-') c=getchar();20 //if (c=='-') q=1, c=getchar();21 while (c>='0' && c<='9') w=w*10+c-'0', c=getchar();22 return w;23 }24 25 int main()26 {27 yyj("a");28 cin>>n;29 for (register llg i=1;i<=n;i++)30 {31 x=getint();32 w+=x;33 }34 ans=1;35 for (register llg i=1;i<=w;i++) if (i+n!=w+1) ans=1LL*ans*i%md;36 cout<