結果

問題 No.1186 長方形の敷き詰め
ユーザー Akijin_007
提出日時 2022-11-04 14:53:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 50 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 65,920 KB
最終ジャッジ日時 2024-07-18 14:25:46
合計ジャッジ時間 2,059 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

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

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

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

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

print(dp[M])


0