結果

問題 No.1186 長方形の敷き詰め
ユーザー tcltktcltk
提出日時 2021-01-17 14:47:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 834 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 851,764 KB
最終ジャッジ日時 2024-05-07 03:49:28
合計ジャッジ時間 4,698 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 157 ms
89,088 KB
testcase_01 AC 156 ms
89,088 KB
testcase_02 AC 157 ms
88,960 KB
testcase_03 AC 155 ms
89,088 KB
testcase_04 AC 157 ms
88,704 KB
testcase_05 AC 156 ms
89,088 KB
testcase_06 AC 156 ms
88,960 KB
testcase_07 AC 157 ms
88,960 KB
testcase_08 WA -
testcase_09 MLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

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