結果

問題 No.1186 長方形の敷き詰め
ユーザー titiatitia
提出日時 2020-08-22 13:38:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 474 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 82,196 KB
実行使用メモリ 243,072 KB
最終ジャッジ日時 2024-04-23 08:04:08
合計ジャッジ時間 8,612 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 261 ms
242,560 KB
testcase_01 AC 251 ms
242,560 KB
testcase_02 AC 263 ms
242,944 KB
testcase_03 AC 253 ms
242,688 KB
testcase_04 AC 255 ms
242,816 KB
testcase_05 AC 257 ms
242,816 KB
testcase_06 AC 261 ms
242,688 KB
testcase_07 AC 262 ms
242,856 KB
testcase_08 AC 258 ms
242,816 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 266 ms
242,816 KB
testcase_12 AC 264 ms
242,688 KB
testcase_13 AC 269 ms
242,816 KB
testcase_14 AC 267 ms
242,688 KB
testcase_15 AC 266 ms
242,816 KB
testcase_16 AC 266 ms
242,560 KB
testcase_17 AC 269 ms
242,944 KB
testcase_18 AC 274 ms
242,560 KB
testcase_19 AC 270 ms
243,072 KB
testcase_20 AC 269 ms
242,688 KB
testcase_21 AC 270 ms
242,688 KB
testcase_22 AC 324 ms
242,688 KB
testcase_23 AC 267 ms
242,832 KB
testcase_24 AC 266 ms
242,688 KB
testcase_25 AC 264 ms
242,688 KB
testcase_26 AC 267 ms
242,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

FACT=[1]
for i in range(1,2*10**6+1):
    FACT.append(FACT[-1]*i%mod)

FACT_INV=[pow(FACT[-1],mod-2,mod)]
for i in range(2*10**6,0,-1):
    FACT_INV.append(FACT_INV[-1]*i%mod)

FACT_INV.reverse()

def Combi(a,b):
    if 0<=b<=a:
        return FACT[a]*FACT_INV[b]*FACT_INV[a-b]%mod
    else:
        return 0

ANS=0
for i in range(M):
    ANS=ANS+Combi(M-(N-1)*i,i)
    ANS%=mod

print(ANS)
0