結果

問題 No.1186 長方形の敷き詰め
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-02-23 02:53:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 642 ms / 2,000 ms
コード長 216 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 11,772 KB
実行使用メモリ 49,104 KB
最終ジャッジ日時 2023-10-21 20:22:54
合計ジャッジ時間 5,127 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,116 KB
testcase_01 AC 28 ms
10,116 KB
testcase_02 AC 355 ms
17,704 KB
testcase_03 AC 28 ms
10,116 KB
testcase_04 AC 31 ms
10,116 KB
testcase_05 AC 29 ms
10,116 KB
testcase_06 AC 28 ms
10,116 KB
testcase_07 AC 28 ms
10,116 KB
testcase_08 AC 29 ms
10,116 KB
testcase_09 AC 29 ms
10,116 KB
testcase_10 AC 29 ms
10,116 KB
testcase_11 AC 29 ms
10,132 KB
testcase_12 AC 32 ms
10,176 KB
testcase_13 AC 29 ms
10,116 KB
testcase_14 AC 31 ms
10,164 KB
testcase_15 AC 29 ms
10,128 KB
testcase_16 AC 30 ms
10,128 KB
testcase_17 AC 135 ms
12,548 KB
testcase_18 AC 259 ms
15,120 KB
testcase_19 AC 305 ms
15,920 KB
testcase_20 AC 318 ms
16,648 KB
testcase_21 AC 227 ms
14,600 KB
testcase_22 AC 642 ms
49,104 KB
testcase_23 AC 368 ms
31,756 KB
testcase_24 AC 422 ms
27,464 KB
testcase_25 AC 227 ms
16,708 KB
testcase_26 AC 252 ms
14,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
n, m = map(int, input().split())
if n == 1: exit(print(1))
dp = [0] * (m + 1)
dp[0] = 1
for i in range(1, m + 1):
    dp[i] += dp[i - 1]
    if i >= n: dp[i] += dp[i - n]
    dp[i] %= mod
print(dp[m])
0