結果

問題 No.1989 Pairing Multiset
ユーザー titiatitia
提出日時 2022-09-20 03:37:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,799 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 76,124 KB
最終ジャッジ日時 2023-08-23 19:20:06
合計ジャッジ時間 21,625 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,776 ms
75,792 KB
testcase_01 AC 1,799 ms
75,996 KB
testcase_02 AC 1,756 ms
76,056 KB
testcase_03 AC 1,791 ms
75,864 KB
testcase_04 AC 68 ms
71,172 KB
testcase_05 AC 69 ms
71,428 KB
testcase_06 AC 69 ms
71,352 KB
testcase_07 AC 70 ms
71,292 KB
testcase_08 AC 1,701 ms
75,772 KB
testcase_09 AC 133 ms
76,124 KB
testcase_10 AC 649 ms
76,072 KB
testcase_11 AC 1,136 ms
75,964 KB
testcase_12 AC 1,212 ms
75,848 KB
testcase_13 AC 1,708 ms
75,756 KB
testcase_14 AC 344 ms
75,968 KB
testcase_15 AC 299 ms
75,972 KB
testcase_16 AC 1,522 ms
75,964 KB
testcase_17 AC 195 ms
76,096 KB
testcase_18 AC 68 ms
71,392 KB
testcase_19 AC 286 ms
75,968 KB
testcase_20 AC 1,779 ms
75,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,M=map(int,input().split())
mod=998244353

def Combi2(a,b):# aは大きいが、bは小さいとき
    if b>a:
        return 0
    ANS=1
    for i in range(min(b,a-b)):
        ANS=ANS*(a-i)%mod*pow(min(b,a-b)-i,mod-2,mod)%mod

    return ANS%mod

print(N*Combi2(2*N+M,2*N+1)%mod)
0