結果

問題 No.2023 Tiling is Fun
ユーザー jakujaku12jakujaku12
提出日時 2022-07-29 22:02:42
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 183 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 76,808 KB
最終ジャッジ日時 2023-09-26 20:59:02
合計ジャッジ時間 3,512 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,248 KB
testcase_01 AC 113 ms
76,576 KB
testcase_02 AC 106 ms
76,596 KB
testcase_03 AC 92 ms
76,216 KB
testcase_04 AC 83 ms
76,292 KB
testcase_05 AC 96 ms
76,712 KB
testcase_06 AC 87 ms
76,328 KB
testcase_07 AC 142 ms
76,716 KB
testcase_08 AC 107 ms
76,764 KB
testcase_09 AC 119 ms
76,808 KB
testcase_10 AC 113 ms
76,736 KB
testcase_11 AC 71 ms
71,320 KB
testcase_12 AC 72 ms
71,348 KB
testcase_13 AC 71 ms
71,420 KB
testcase_14 AC 73 ms
71,348 KB
testcase_15 AC 72 ms
71,364 KB
testcase_16 AC 71 ms
71,344 KB
testcase_17 AC 174 ms
76,808 KB
testcase_18 AC 183 ms
76,760 KB
testcase_19 AC 122 ms
76,756 KB
権限があれば一括ダウンロードができます

ソースコード

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