結果

問題 No.2023 Tiling is Fun
ユーザー tktk_snsntktk_snsn
提出日時 2022-07-29 22:01:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 443 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 10,812 KB
実行使用メモリ 23,700 KB
最終ジャッジ日時 2023-09-26 20:55:07
合計ジャッジ時間 4,586 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 165 ms
23,340 KB
testcase_01 AC 167 ms
23,464 KB
testcase_02 AC 165 ms
23,576 KB
testcase_03 AC 164 ms
23,400 KB
testcase_04 AC 168 ms
23,464 KB
testcase_05 AC 165 ms
23,700 KB
testcase_06 AC 167 ms
23,396 KB
testcase_07 AC 165 ms
23,488 KB
testcase_08 AC 163 ms
23,480 KB
testcase_09 AC 165 ms
23,388 KB
testcase_10 AC 163 ms
23,400 KB
testcase_11 AC 165 ms
23,380 KB
testcase_12 AC 166 ms
23,332 KB
testcase_13 AC 167 ms
23,396 KB
testcase_14 AC 165 ms
23,500 KB
testcase_15 AC 166 ms
23,660 KB
testcase_16 AC 164 ms
23,364 KB
testcase_17 AC 163 ms
23,668 KB
testcase_18 AC 164 ms
23,336 KB
testcase_19 AC 165 ms
23,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353

Fsize = 2 * 10 ** 5 + 100
fact = [1] * (Fsize + Fsize + 5)
for i in range(2, Fsize+1):
    fact[i] = fact[i-1] * i % mod
fact[-Fsize] = pow(fact[Fsize], mod-2, mod)
for i in reversed(range(2, Fsize + 1)):
    fact[-i+1] = fact[-i] * i % mod


def comb(n, k):
    if k < 0 or k > n:
        return 0
    return fact[n] * fact[-k] % mod * fact[-(n-k)] % mod


a, b = map(int, input().split())

print(comb(a - 1 + b - 1, a - 1))
0