結果

問題 No.2511 Mountain Sequence
ユーザー ゼットゼット
提出日時 2023-10-23 19:11:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 245 ms / 2,000 ms
コード長 470 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 81,684 KB
実行使用メモリ 76,524 KB
最終ジャッジ日時 2023-10-23 19:12:07
合計ジャッジ時間 7,530 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,272 KB
testcase_01 AC 38 ms
53,272 KB
testcase_02 AC 146 ms
68,232 KB
testcase_03 AC 172 ms
69,644 KB
testcase_04 AC 106 ms
68,044 KB
testcase_05 AC 151 ms
72,052 KB
testcase_06 AC 119 ms
68,140 KB
testcase_07 AC 205 ms
73,948 KB
testcase_08 AC 106 ms
68,308 KB
testcase_09 AC 112 ms
66,004 KB
testcase_10 AC 216 ms
74,684 KB
testcase_11 AC 185 ms
73,524 KB
testcase_12 AC 101 ms
63,224 KB
testcase_13 AC 222 ms
75,060 KB
testcase_14 AC 196 ms
74,524 KB
testcase_15 AC 187 ms
73,580 KB
testcase_16 AC 165 ms
71,636 KB
testcase_17 AC 216 ms
76,492 KB
testcase_18 AC 224 ms
75,124 KB
testcase_19 AC 230 ms
75,476 KB
testcase_20 AC 243 ms
76,372 KB
testcase_21 AC 211 ms
76,172 KB
testcase_22 AC 224 ms
75,132 KB
testcase_23 AC 82 ms
63,936 KB
testcase_24 AC 88 ms
64,280 KB
testcase_25 AC 145 ms
68,040 KB
testcase_26 AC 73 ms
63,360 KB
testcase_27 AC 111 ms
65,728 KB
testcase_28 AC 40 ms
53,272 KB
testcase_29 AC 245 ms
76,524 KB
testcase_30 AC 242 ms
76,268 KB
testcase_31 AC 243 ms
76,364 KB
testcase_32 AC 222 ms
75,060 KB
testcase_33 AC 205 ms
75,452 KB
testcase_34 AC 238 ms
75,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
K=2*(M+N)
mod=998244353
u=[1]*(K+1)
for i in range(1,K+1):
  u[i]=u[i-1]*i
  u[i]%=mod
u2=[1]*(K+1)
for i in range(1,K+1):
  ans=1
  w=u[i]
  n=mod-2
  while n>0:
    if n&1:
      ans*=w
      ans%=mod
    w**=2
    w%=mod
    n//=2
  u2[i]=ans
def ncm(x,y):
  if y>x:
    return 0
  ans=u[x]
  ans*=u2[y]
  ans%=mod
  ans*=u2[x-y]
  ans%=mod
  return ans
result=0
for k in range(1,M+1):
  result+=ncm(2*k-2,N-1)
  result%=mod
print(result)
0