結果

問題 No.1186 長方形の敷き詰め
ユーザー Akijin_007Akijin_007
提出日時 2022-11-04 14:53:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 83,852 KB
最終ジャッジ日時 2023-09-25 18:12:39
合計ジャッジ時間 3,874 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,396 KB
testcase_01 AC 70 ms
71,504 KB
testcase_02 AC 83 ms
83,848 KB
testcase_03 AC 73 ms
71,260 KB
testcase_04 AC 68 ms
71,112 KB
testcase_05 AC 70 ms
71,416 KB
testcase_06 AC 71 ms
71,216 KB
testcase_07 AC 71 ms
71,384 KB
testcase_08 AC 70 ms
70,996 KB
testcase_09 AC 69 ms
71,196 KB
testcase_10 AC 69 ms
71,332 KB
testcase_11 AC 72 ms
76,000 KB
testcase_12 AC 73 ms
76,016 KB
testcase_13 AC 72 ms
75,828 KB
testcase_14 AC 72 ms
75,608 KB
testcase_15 AC 74 ms
75,788 KB
testcase_16 AC 73 ms
75,860 KB
testcase_17 AC 76 ms
78,120 KB
testcase_18 AC 81 ms
80,980 KB
testcase_19 AC 83 ms
81,964 KB
testcase_20 AC 81 ms
82,436 KB
testcase_21 AC 77 ms
80,648 KB
testcase_22 AC 84 ms
83,852 KB
testcase_23 AC 82 ms
80,500 KB
testcase_24 AC 86 ms
82,912 KB
testcase_25 AC 83 ms
80,052 KB
testcase_26 AC 79 ms
80,764 KB
権限があれば一括ダウンロードができます

ソースコード

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