結果

問題 No.1186 長方形の敷き詰め
ユーザー tonyu0tonyu0
提出日時 2020-08-22 15:19:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 538 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 82,576 KB
実行使用メモリ 71,540 KB
最終ジャッジ日時 2024-04-23 09:40:28
合計ジャッジ時間 3,689 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,172 KB
testcase_01 AC 39 ms
52,484 KB
testcase_02 AC 52 ms
65,864 KB
testcase_03 AC 38 ms
52,472 KB
testcase_04 AC 37 ms
53,068 KB
testcase_05 AC 37 ms
52,544 KB
testcase_06 AC 37 ms
52,472 KB
testcase_07 AC 36 ms
53,000 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 41 ms
58,248 KB
testcase_12 AC 40 ms
58,556 KB
testcase_13 AC 41 ms
57,592 KB
testcase_14 AC 37 ms
58,928 KB
testcase_15 AC 38 ms
58,004 KB
testcase_16 AC 38 ms
58,564 KB
testcase_17 AC 46 ms
61,244 KB
testcase_18 AC 47 ms
62,980 KB
testcase_19 AC 49 ms
64,748 KB
testcase_20 AC 51 ms
64,952 KB
testcase_21 AC 48 ms
63,960 KB
testcase_22 AC 505 ms
69,340 KB
testcase_23 AC 47 ms
62,908 KB
testcase_24 AC 48 ms
65,300 KB
testcase_25 AC 44 ms
63,420 KB
testcase_26 AC 44 ms
63,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
mod = 998244353

# 1 * nで
# n * mを埋める

# nの使い方
# まずたて * m
# そのうちm - n, m - n - nを横にする。
# たてnなので横の列は横におくしかない
# 横の種類数はm // nこ


fact = [1] * (m + 5)
for i in range(1, m + 5):
    fact[i] = fact[i - 1] * i % mod


def comb(n, k):
    return fact[n] * pow(fact[n - k] * fact[k] % mod, mod - 2, mod) % mod


ans = 0
for i in range(m // n + 1):
    tot = m - n * i + i
    ans = (ans + comb(tot, i)) % mod
print(ans)
0