結果

問題 No.1186 長方形の敷き詰め
ユーザー Chihaya_chanChihaya_chan
提出日時 2020-09-02 00:21:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 281 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 82,380 KB
実行使用メモリ 67,668 KB
最終ジャッジ日時 2024-05-01 00:47:35
合計ジャッジ時間 2,291 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
60,600 KB
testcase_01 AC 40 ms
61,648 KB
testcase_02 AC 39 ms
52,564 KB
testcase_03 AC 41 ms
59,784 KB
testcase_04 AC 39 ms
60,552 KB
testcase_05 AC 39 ms
59,904 KB
testcase_06 AC 36 ms
52,760 KB
testcase_07 AC 40 ms
60,516 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 36 ms
52,412 KB
testcase_12 AC 36 ms
52,212 KB
testcase_13 AC 38 ms
53,132 KB
testcase_14 AC 35 ms
52,332 KB
testcase_15 AC 36 ms
51,952 KB
testcase_16 AC 43 ms
66,024 KB
testcase_17 AC 36 ms
53,564 KB
testcase_18 AC 36 ms
53,880 KB
testcase_19 AC 37 ms
52,444 KB
testcase_20 AC 37 ms
52,156 KB
testcase_21 AC 36 ms
53,556 KB
testcase_22 AC 49 ms
66,984 KB
testcase_23 AC 47 ms
65,560 KB
testcase_24 AC 48 ms
67,548 KB
testcase_25 AC 46 ms
67,012 KB
testcase_26 AC 44 ms
66,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
if N > M:
    print(1)
else:
    # N<M
    mod = 998244353
    dp = [0]*(10**6+10)
    dp[0] = 1
    for i in range(1, M+1):
        if i >= N:
            dp[i] = (dp[i-1] + dp[i-N]) % mod
        else:
            dp[i] = dp[i-1]
    print(dp[M])
0