結果

問題 No.1186 長方形の敷き詰め
ユーザー Mottchan
提出日時 2025-09-03 17:00:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,148 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 82,232 KB
実行使用メモリ 75,988 KB
最終ジャッジ日時 2025-09-03 17:00:14
合計ジャッジ時間 3,755 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
# 0~9を並び替えるならpermutationsかconbinations,N列のカテゴリを作るにはproduct
from itertools import product, permutations, combinations, accumulate
from functools import lru_cache  # @lru_cache(maxsize=128)
import operator
from string import ascii_uppercase, ascii_lowercase, digits  # 英字(大文字), 英字(小文字), 数字
MOD = 998244353
def II(): return int(input())
def LI(): return list(input())
def LMI(): return list(map(int, input().split()))
def LMS(): return list(map(str, input().split()))
def LLMI(x): return [list(map(int, input().split())) for _ in range(x)]
def LLMS(x): return [list(input()) for _ in range(x)]
  
def execute():
    n, m = LMI()

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

    for i in range(1, m + 1):
        if i < n:
            dp[i] = dp[i - 1]
        else:
            dp[i] = dp[i - n] + dp[i - 1]
        
        dp[i] %= MOD
    
    # print(dp)
    print(dp[-1]%MOD)

if __name__ == "__main__":
    T = 1
    for _ in range(T):
        execute()
0