結果

問題 No.1186 長方形の敷き詰め
ユーザー marroncastlemarroncastle
提出日時 2020-08-22 14:49:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 82,292 KB
実行使用メモリ 66,724 KB
最終ジャッジ日時 2024-04-23 09:14:58
合計ジャッジ時間 2,197 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
51,884 KB
testcase_01 AC 33 ms
52,260 KB
testcase_02 AC 59 ms
66,520 KB
testcase_03 AC 34 ms
52,080 KB
testcase_04 AC 32 ms
53,540 KB
testcase_05 AC 31 ms
52,316 KB
testcase_06 AC 33 ms
53,076 KB
testcase_07 AC 33 ms
52,468 KB
testcase_08 AC 32 ms
52,532 KB
testcase_09 AC 32 ms
53,360 KB
testcase_10 AC 37 ms
52,352 KB
testcase_11 AC 36 ms
58,252 KB
testcase_12 AC 35 ms
58,552 KB
testcase_13 AC 37 ms
58,720 KB
testcase_14 AC 35 ms
57,632 KB
testcase_15 AC 37 ms
58,224 KB
testcase_16 AC 35 ms
58,128 KB
testcase_17 AC 46 ms
61,584 KB
testcase_18 AC 52 ms
63,744 KB
testcase_19 AC 55 ms
64,756 KB
testcase_20 AC 55 ms
65,992 KB
testcase_21 AC 51 ms
62,484 KB
testcase_22 AC 59 ms
66,724 KB
testcase_23 AC 50 ms
62,420 KB
testcase_24 AC 59 ms
65,768 KB
testcase_25 AC 50 ms
63,088 KB
testcase_26 AC 51 ms
62,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
  mod = 998244353
  N, M = map(int, input().split())
  if N==1:
    return 1
  dp = [0]*(M+1)
  dp[0] = 1
  for i in range(1,M+1):
    dp[i] = dp[i-1]
    if i>=N:
      dp[i] += dp[i-N]
    dp[i] %= mod
  ans = dp[-1]
  return ans
print(solve())
0