Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
33225 李羽乔 【S】T1 C++ 运行超时 70 1000 MS 1848 KB 839 2024-10-04 17:09:48

Tests(7/10):


#include<bits/stdc++.h> using namespace std; const int N = 510,M = 1e5+10,md = 998244353; #define int long long int n; int m; int inv[N+M],pre[N+M]; int quickpow(int x,int y){ int tot=1; while(y){ if(y&1) tot=tot%md*x%md; x=x%md*x%md; y=y>>1; } return tot; } int C(int x,int y){ if(x<y) return 0; else return (pre[x]%md*inv[y]%md*inv[x-y]%md+md)%md; } signed main(){ ios::sync_with_stdio(false); cin>>n>>m; pre[0]=1; for(int i=1;i<=n+m;i++){ pre[i]=pre[i-1]*i%md; } for(int i=n+m;i>=0;i--){ inv[i]=quickpow(pre[i],md-2); } int ANS=0; for(int i=0;i<=m;i++){ for(int j=0;j<=n;j++){ int z=(2*m-2*i)%md*(2*m-2*i)%md; int p=C(n+i-1,i)*C(n,j)%md; int q=C(m-i-1,j-1)*C(n-j+m-i-1,m-i)%md; ANS=(ANS%md+z%md*p%md*q%md)%md; } } cout<<ANS%md<<endl; return 0; }


测评信息: