結果

問題 No.1186 長方形の敷き詰め
ユーザー Chihaya_chanChihaya_chan
提出日時 2020-09-02 00:24:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 328 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 82,452 KB
実行使用メモリ 67,452 KB
最終ジャッジ日時 2024-05-01 01:12:56
合計ジャッジ時間 1,852 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
60,824 KB
testcase_01 AC 38 ms
60,916 KB
testcase_02 AC 34 ms
52,564 KB
testcase_03 AC 36 ms
61,744 KB
testcase_04 AC 35 ms
59,540 KB
testcase_05 AC 37 ms
60,316 KB
testcase_06 AC 33 ms
53,088 KB
testcase_07 AC 36 ms
60,792 KB
testcase_08 AC 33 ms
52,608 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 33 ms
52,872 KB
testcase_12 AC 32 ms
52,636 KB
testcase_13 AC 33 ms
53,408 KB
testcase_14 AC 31 ms
53,228 KB
testcase_15 AC 31 ms
52,256 KB
testcase_16 AC 38 ms
66,080 KB
testcase_17 AC 32 ms
52,200 KB
testcase_18 AC 32 ms
53,068 KB
testcase_19 AC 31 ms
52,432 KB
testcase_20 AC 31 ms
52,156 KB
testcase_21 AC 32 ms
52,952 KB
testcase_22 AC 44 ms
66,856 KB
testcase_23 AC 40 ms
66,928 KB
testcase_24 AC 44 ms
67,452 KB
testcase_25 AC 40 ms
66,700 KB
testcase_26 AC 39 ms
66,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
if N > M:
    print(1)
else:
    # N<M
    if M == 1:
        print(1)
        exit()
    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