結果

問題 No.1989 Pairing Multiset
ユーザー nephrologistnephrologist
提出日時 2022-06-25 09:59:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,880 ms / 2,000 ms
コード長 834 bytes
コンパイル時間 436 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 59,392 KB
最終ジャッジ日時 2024-04-26 15:59:18
合計ジャッジ時間 24,387 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,864 ms
59,008 KB
testcase_01 AC 1,855 ms
59,264 KB
testcase_02 AC 1,880 ms
59,136 KB
testcase_03 AC 1,877 ms
58,880 KB
testcase_04 AC 39 ms
51,712 KB
testcase_05 AC 1,866 ms
59,008 KB
testcase_06 AC 39 ms
51,456 KB
testcase_07 AC 39 ms
52,096 KB
testcase_08 AC 1,769 ms
59,136 KB
testcase_09 AC 107 ms
59,008 KB
testcase_10 AC 648 ms
59,008 KB
testcase_11 AC 1,167 ms
59,008 KB
testcase_12 AC 1,248 ms
58,624 KB
testcase_13 AC 1,785 ms
59,008 KB
testcase_14 AC 360 ms
59,008 KB
testcase_15 AC 292 ms
59,392 KB
testcase_16 AC 1,565 ms
59,136 KB
testcase_17 AC 175 ms
59,008 KB
testcase_18 AC 38 ms
52,096 KB
testcase_19 AC 270 ms
59,392 KB
testcase_20 AC 1,844 ms
59,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline
#input = sys.stdin.buffer.readline #文字列はダメ
#sys.setrecursionlimit(1000000)
#import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
#from collections import defaultdict 
#from collections import deque
#import copy
#import math
#from functools import lru_cache
#@lru_cache(maxsize=None)
#MOD = pow(10,9) + 7
MOD = 998244353
#dx = [1,0,-1,0]
#dy = [0,1,0,-1]
#dx8 = [1,1,0,-1,-1,-1,0,1]
#dy8 = [0,1,1,1,0,-1,-1,-1]




def main():
    N,M = map(int,input().split())
    #広義単調増加数列(=多重集合)を経路数に帰着する。
    cmb = N
    n = 2*N+M
    k = 2*N+1
    for i in range(k):
        temp = (n-i) * pow(i+1,MOD-2,MOD)%MOD
        cmb *= temp
        cmb %= MOD
    print(cmb%MOD)



if __name__ == '__main__':
    main()
0