結果

問題 No.1989 Pairing Multiset
ユーザー ygd.ygd.
提出日時 2022-06-25 09:41:19
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 830 bytes
コンパイル時間 551 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 75,904 KB
最終ジャッジ日時 2024-04-26 15:42:35
合計ジャッジ時間 26,310 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 TLE -
testcase_03 TLE -
testcase_04 AC 39 ms
51,968 KB
testcase_05 TLE -
testcase_06 AC 38 ms
51,968 KB
testcase_07 AC 39 ms
51,584 KB
testcase_08 AC 1,946 ms
75,264 KB
testcase_09 AC 115 ms
66,432 KB
testcase_10 AC 715 ms
75,204 KB
testcase_11 AC 1,277 ms
75,008 KB
testcase_12 AC 1,390 ms
75,264 KB
testcase_13 AC 1,987 ms
75,148 KB
testcase_14 AC 369 ms
75,136 KB
testcase_15 AC 322 ms
75,136 KB
testcase_16 AC 1,735 ms
75,184 KB
testcase_17 AC 185 ms
73,728 KB
testcase_18 AC 37 ms
52,080 KB
testcase_19 AC 295 ms
75,264 KB
testcase_20 TLE -
権限があれば一括ダウンロードができます

ソースコード

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)
        cmb *= temp
        cmb %= MOD
    print(cmb%MOD)



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