結果

問題 No.1186 長方形の敷き詰め
ユーザー NoneNone
提出日時 2021-03-17 04:46:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 82,488 KB
実行使用メモリ 68,640 KB
最終ジャッジ日時 2024-04-26 13:35:31
合計ジャッジ時間 2,273 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,652 KB
testcase_01 AC 36 ms
52,628 KB
testcase_02 AC 51 ms
68,640 KB
testcase_03 AC 36 ms
52,636 KB
testcase_04 AC 35 ms
52,140 KB
testcase_05 AC 37 ms
52,884 KB
testcase_06 AC 35 ms
52,852 KB
testcase_07 AC 34 ms
52,632 KB
testcase_08 AC 35 ms
53,696 KB
testcase_09 AC 38 ms
60,028 KB
testcase_10 AC 37 ms
53,276 KB
testcase_11 AC 42 ms
59,300 KB
testcase_12 AC 40 ms
59,276 KB
testcase_13 AC 41 ms
59,428 KB
testcase_14 AC 42 ms
61,060 KB
testcase_15 AC 40 ms
59,920 KB
testcase_16 AC 42 ms
60,260 KB
testcase_17 AC 46 ms
61,592 KB
testcase_18 AC 47 ms
65,128 KB
testcase_19 AC 48 ms
65,812 KB
testcase_20 AC 50 ms
66,344 KB
testcase_21 AC 49 ms
65,084 KB
testcase_22 AC 54 ms
66,808 KB
testcase_23 AC 51 ms
65,408 KB
testcase_24 AC 56 ms
68,296 KB
testcase_25 AC 55 ms
65,804 KB
testcase_26 AC 49 ms
65,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int, input().split())
MOD=998244353
dp=[0]*(M+2)
dp[0]=1

if N==1:
    print(1)
else:
    for i in range(M):
        dp[min(i+1,M+1)]+=dp[i]
        dp[min(i+N,M+1)]+=dp[i]
        dp[min(i+1,M+1)]%=MOD
        dp[min(i+N,M+1)]%=MOD


    print(dp[M])
0