結果

問題 No.1989 Pairing Multiset
コンテスト
ユーザー vjudge1
提出日時 2025-10-16 15:42:23
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 448 bytes
コンパイル時間 1,514 ms
コンパイル使用メモリ 161,696 KB
実行使用メモリ 19,016 KB
最終ジャッジ日時 2025-10-16 15:42:32
合計ジャッジ時間 8,088 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other TLE * 1 -- * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define int long long
using namespace std;
int n,m;
const int mod=998244353;
int qp(int a,int b){
	int ans=1;
	while(b){
		if(b&1){
			ans=ans*a;
			ans%=mod;
		}
		a=a*a;a%=mod;
		b>>=1;
	}
	return ans;
}
int C(int n,int m){
	int ans=1;
	for(int x=m+1;x<=n;x++){
		ans=ans*x%mod;
	}
	for(int x=1;x<=n-m;x++){
		ans=ans*qp(x,mod-2)%mod;
	}
	return ans%mod;
}
signed main(){
	cin>>n>>m;
	cout<<n*C(n*2+m,n*2+1)%mod;
}
/*

*/
0