結果

問題 No.2023 Tiling is Fun
ユーザー lloyzlloyz
提出日時 2022-07-29 23:30:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 368 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 86,652 KB
実行使用メモリ 80,396 KB
最終ジャッジ日時 2023-09-26 23:18:30
合計ジャッジ時間 3,025 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,932 KB
testcase_01 AC 82 ms
78,664 KB
testcase_02 AC 81 ms
77,228 KB
testcase_03 AC 82 ms
77,276 KB
testcase_04 AC 78 ms
75,696 KB
testcase_05 AC 80 ms
76,928 KB
testcase_06 AC 80 ms
77,092 KB
testcase_07 AC 86 ms
79,472 KB
testcase_08 AC 82 ms
77,832 KB
testcase_09 AC 84 ms
78,716 KB
testcase_10 AC 85 ms
78,560 KB
testcase_11 AC 73 ms
70,780 KB
testcase_12 AC 73 ms
71,068 KB
testcase_13 AC 73 ms
71,152 KB
testcase_14 AC 82 ms
78,288 KB
testcase_15 AC 83 ms
78,144 KB
testcase_16 AC 83 ms
77,948 KB
testcase_17 AC 88 ms
80,396 KB
testcase_18 AC 89 ms
80,360 KB
testcase_19 AC 85 ms
79,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

fact = [1] * (a + b)
inv = [1] * (a + b)
finv = [1] * (a + b)
for i in range(2, a + b):
    fact[i] = fact[i - 1] * i % mod
    inv[i] = mod - inv[mod % i] * (mod // i) % mod
    finv[i] = finv[i - 1] * inv[i] % mod
def comb(x, y):
    return fact[x] * finv[y] % mod * finv[x - y] % mod

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