結果

問題 No.2023 Tiling is Fun
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-07-29 22:22:20
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 79,244 KB
最終ジャッジ日時 2023-09-26 21:38:41
合計ジャッジ時間 2,969 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,160 KB
testcase_01 AC 81 ms
77,916 KB
testcase_02 AC 78 ms
76,972 KB
testcase_03 AC 77 ms
77,320 KB
testcase_04 AC 76 ms
76,012 KB
testcase_05 AC 80 ms
76,900 KB
testcase_06 AC 81 ms
77,008 KB
testcase_07 AC 81 ms
78,672 KB
testcase_08 AC 78 ms
77,444 KB
testcase_09 AC 80 ms
78,340 KB
testcase_10 AC 78 ms
78,052 KB
testcase_11 AC 71 ms
71,212 KB
testcase_12 AC 69 ms
71,196 KB
testcase_13 AC 68 ms
71,264 KB
testcase_14 AC 79 ms
77,632 KB
testcase_15 AC 78 ms
77,736 KB
testcase_16 AC 77 ms
77,772 KB
testcase_17 AC 80 ms
79,244 KB
testcase_18 AC 80 ms
79,100 KB
testcase_19 AC 78 ms
78,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b = map(int,input().split())
n = a + b
fac_arr = [1] * (n+1)
r_s_fac_arr = [1] * (n+1)
mod = 998244353 
for i in range(1,n+1):
    fac_arr[i] = (fac_arr[i-1]) * i % mod
    fac_arr[i] %= mod
r_s_fac_arr[n] = pow(fac_arr[n],mod-2,mod)
for i in range(n-1,-1,-1):
    r_s_fac_arr[i] = (r_s_fac_arr[i+1] % mod) * (i+1)
    r_s_fac_arr[i] %= mod
def nckMod(n,k):
    return fac_arr[n]  % mod *  r_s_fac_arr[k] % mod * r_s_fac_arr[n-k] % mod
print(nckMod(a+b-2,a-1))
0