結果

問題 No.1989 Pairing Multiset
ユーザー vjudge1
提出日時 2025-10-09 22:02:46
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 411 bytes
コンパイル時間 1,866 ms
コンパイル使用メモリ 161,724 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-09 22:02:50
合計ジャッジ時間 2,488 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int mod=998244353;
int n,m,a,b=1;
int qpow(int a,int b){
	int t=1;
	while(b){
		if(b&1)t=t*a%mod;
		b/=2,a=a*a%mod;
	}
	return t;
}
signed main(){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>n>>m,a=n;
	for(int i=m;i<=2*n+m;i++)a=a*i%mod;
	for(int i=1;i<=2*n+1;i++)b=b*i%mod;
	cout<<a*qpow(b,mod-2)%mod<<"\n";
	return 0;
}
0