結果

問題 No.2023 Tiling is Fun
ユーザー jakujaku12
提出日時 2022-07-29 22:02:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 82,736 KB
実行使用メモリ 75,940 KB
最終ジャッジ日時 2024-07-19 14:48:08
合計ジャッジ時間 2,347 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

def modpow(a,n,Mod):
    res=1
    while n>0:
        if n & 1:
            res=res * a %Mod
        a=a*a%Mod
        n>>=1
    return res

def modinv(a,Mod):
    return modpow(a,Mod-2,Mod)

a,b=map(int,input().split())
res=1
A=(a-1+b-1)
B=min(a-1,b-1)
for i in range(B):
    res*=A-i
    res*=modinv(i+1,998244353)
    res%=998244353
print(res)
0