結果

問題 No.1186 長方形の敷き詰め
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2020-08-22 13:30:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 351 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 82,184 KB
実行使用メモリ 67,568 KB
最終ジャッジ日時 2024-04-23 07:57:13
合計ジャッジ時間 2,048 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,664 KB
testcase_01 AC 33 ms
53,880 KB
testcase_02 AC 33 ms
52,880 KB
testcase_03 AC 32 ms
52,376 KB
testcase_04 AC 32 ms
52,028 KB
testcase_05 AC 33 ms
53,852 KB
testcase_06 AC 33 ms
52,036 KB
testcase_07 AC 33 ms
53,776 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 34 ms
53,512 KB
testcase_12 AC 34 ms
53,544 KB
testcase_13 AC 32 ms
52,068 KB
testcase_14 AC 32 ms
52,452 KB
testcase_15 AC 32 ms
52,924 KB
testcase_16 AC 36 ms
59,408 KB
testcase_17 AC 33 ms
52,984 KB
testcase_18 AC 33 ms
52,344 KB
testcase_19 AC 33 ms
52,412 KB
testcase_20 AC 34 ms
53,684 KB
testcase_21 AC 34 ms
52,816 KB
testcase_22 AC 49 ms
66,564 KB
testcase_23 AC 44 ms
64,716 KB
testcase_24 AC 47 ms
67,568 KB
testcase_25 AC 46 ms
64,056 KB
testcase_26 AC 42 ms
62,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

N*Nの範囲だけ、横向きでも行ける

"""

N,M = map(int,input().split())

if N > M:
    print (1)
else:
    dp = [0] * (M+1)
    dp[0] = 1
    mod = 998244353

    for i in range(M):
        dp[i+1] += dp[i]
        dp[i+1] %= mod

        if i+N <= M:
            dp[i+N] += dp[i]
            dp[i+N] %= mod

    print (dp[-1] % mod)
0