結果

問題 No.1186 長方形の敷き詰め
ユーザー yatsurugiyatsurugi
提出日時 2020-09-26 15:29:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 915 ms / 2,000 ms
コード長 264 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 10,608 KB
実行使用メモリ 47,128 KB
最終ジャッジ日時 2023-09-11 12:18:11
合計ジャッジ時間 6,088 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,732 KB
testcase_01 AC 17 ms
7,928 KB
testcase_02 AC 434 ms
15,700 KB
testcase_03 AC 16 ms
7,788 KB
testcase_04 AC 16 ms
7,792 KB
testcase_05 AC 15 ms
7,728 KB
testcase_06 AC 16 ms
7,728 KB
testcase_07 AC 16 ms
7,788 KB
testcase_08 AC 16 ms
8,132 KB
testcase_09 AC 16 ms
8,020 KB
testcase_10 AC 16 ms
8,060 KB
testcase_11 AC 17 ms
7,824 KB
testcase_12 AC 19 ms
7,756 KB
testcase_13 AC 16 ms
7,728 KB
testcase_14 AC 18 ms
7,908 KB
testcase_15 AC 16 ms
7,804 KB
testcase_16 AC 17 ms
7,836 KB
testcase_17 AC 136 ms
10,328 KB
testcase_18 AC 264 ms
13,060 KB
testcase_19 AC 315 ms
14,032 KB
testcase_20 AC 366 ms
14,676 KB
testcase_21 AC 247 ms
12,688 KB
testcase_22 AC 915 ms
47,128 KB
testcase_23 AC 491 ms
29,524 KB
testcase_24 AC 509 ms
25,584 KB
testcase_25 AC 258 ms
14,476 KB
testcase_26 AC 259 ms
12,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
mod = 998244353

if N == 1:
    print(1)
    exit()

dp = [0] * (M + 2)
dp[0] = 1

for i in range(M):
    dp[i + 1] += dp[i]
    dp[i + 1] %= mod
    if i + N <= M:
        dp[i + N] += dp[i]
        dp[i + N] %= mod

print(dp[M])
0