結果

問題 No.1186 長方形の敷き詰め
ユーザー rlangevinrlangevin
提出日時 2023-01-02 13:07:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 236 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 83,964 KB
最終ジャッジ日時 2023-08-17 23:28:29
合計ジャッジ時間 3,667 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,308 KB
testcase_01 AC 73 ms
71,332 KB
testcase_02 AC 88 ms
83,932 KB
testcase_03 AC 74 ms
70,948 KB
testcase_04 AC 75 ms
71,100 KB
testcase_05 AC 75 ms
71,300 KB
testcase_06 AC 74 ms
71,068 KB
testcase_07 AC 75 ms
71,232 KB
testcase_08 AC 75 ms
71,068 KB
testcase_09 AC 88 ms
83,576 KB
testcase_10 AC 78 ms
76,076 KB
testcase_11 AC 77 ms
75,864 KB
testcase_12 AC 75 ms
76,000 KB
testcase_13 AC 77 ms
75,728 KB
testcase_14 AC 78 ms
75,752 KB
testcase_15 AC 78 ms
75,936 KB
testcase_16 AC 80 ms
75,660 KB
testcase_17 AC 83 ms
78,120 KB
testcase_18 AC 85 ms
80,884 KB
testcase_19 AC 84 ms
81,804 KB
testcase_20 AC 86 ms
82,532 KB
testcase_21 AC 84 ms
80,496 KB
testcase_22 AC 90 ms
83,964 KB
testcase_23 AC 86 ms
80,376 KB
testcase_24 AC 93 ms
82,596 KB
testcase_25 AC 88 ms
80,172 KB
testcase_26 AC 85 ms
80,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
mod = 998244353
dp = [0] * (M + 1)
dp[0] = 1
for i in range(M):
    dp[i + 1] += dp[i]
    dp[i + 1] %= mod
    if i + N <= M and N != 1:
        dp[i + N] += dp[i]
        dp[i + N] %= mod
print(dp[-1])
0