結果

問題 No.2511 Mountain Sequence
ユーザー chineristACchineristAC
提出日時 2023-10-20 21:44:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 597 bytes
コンパイル時間 3,227 ms
コンパイル使用メモリ 81,640 KB
実行使用メモリ 73,776 KB
最終ジャッジ日時 2023-10-20 21:45:13
合計ジャッジ時間 4,372 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,232 KB
testcase_01 AC 80 ms
71,232 KB
testcase_02 AC 80 ms
73,776 KB
testcase_03 AC 76 ms
71,692 KB
testcase_04 AC 80 ms
73,776 KB
testcase_05 AC 85 ms
73,776 KB
testcase_06 AC 87 ms
73,776 KB
testcase_07 AC 81 ms
73,776 KB
testcase_08 AC 80 ms
73,776 KB
testcase_09 AC 75 ms
71,692 KB
testcase_10 AC 79 ms
73,776 KB
testcase_11 AC 80 ms
73,776 KB
testcase_12 AC 73 ms
71,232 KB
testcase_13 AC 79 ms
73,776 KB
testcase_14 AC 79 ms
73,776 KB
testcase_15 AC 81 ms
73,776 KB
testcase_16 AC 83 ms
73,776 KB
testcase_17 AC 81 ms
73,776 KB
testcase_18 AC 80 ms
73,776 KB
testcase_19 AC 82 ms
73,776 KB
testcase_20 AC 81 ms
73,776 KB
testcase_21 AC 80 ms
73,776 KB
testcase_22 AC 81 ms
73,776 KB
testcase_23 AC 78 ms
71,700 KB
testcase_24 AC 78 ms
71,700 KB
testcase_25 AC 82 ms
71,700 KB
testcase_26 AC 92 ms
71,700 KB
testcase_27 AC 77 ms
71,700 KB
testcase_28 AC 74 ms
71,232 KB
testcase_29 AC 91 ms
73,776 KB
testcase_30 AC 88 ms
73,776 KB
testcase_31 AC 83 ms
73,776 KB
testcase_32 AC 84 ms
73,776 KB
testcase_33 AC 82 ms
73,776 KB
testcase_34 AC 81 ms
73,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    return (g1[n] * g2[r] % mod) * g2[n-r] % mod


mod = 998244353
N = 5*10**5
g1 = [1]*(N+1)
g2 = [1]*(N+1)
inverse = [1]*(N+1)

for i in range( 2, N + 1 ):
    g1[i]=( ( g1[i-1] * i ) % mod )
    inverse[i]=( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2[i]=( (g2[i-1] * inverse[i]) % mod )
inverse[0]=0

N,M = mi()

res = 0

for val in range(1,M+1):
    res += cmb(2*val-2,N-1,mod)
    res %= mod

print(res)


0