結果

問題 No.1186 長方形の敷き詰め
ユーザー tcltk
提出日時 2021-01-17 14:47:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 834 bytes
コンパイル時間 1,015 ms
コンパイル使用メモリ 82,312 KB
実行使用メモリ 849,244 KB
最終ジャッジ日時 2024-11-29 16:29:39
合計ジャッジ時間 10,605 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 2 RE * 1 MLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#region Header
#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
from queue import PriorityQueue
import bisect
import heapq

def input():
    return sys.stdin.readline()[:-1]

sys.setrecursionlimit(1000000)
#endregion

# _INPUT = """# paste here...
# """
# sys.stdin = io.StringIO(_INPUT)

MOD = 998244353

def solve(N, M):

    if M < N:
        return 1

    elif M == N:
        return 2

    else:
        dp = [0 for _ in range(M+1)]
        dp[0] = 1
        for i in range(M):
            dp[i+1] += dp[i]
            if i+N <= M:
                dp[i+N] += dp[i]
        return dp[M]

def main():
    N, M = map(int, input().split())
    print(solve(N, M))

if __name__ == '__main__':
    main()
0