結果

問題 No.1186 長方形の敷き詰め
ユーザー もりをもりを
提出日時 2020-08-22 13:29:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 309 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 52,020 KB
最終ジャッジ日時 2024-04-23 07:56:13
合計ジャッジ時間 15,563 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 449 ms
50,996 KB
testcase_01 AC 442 ms
44,048 KB
testcase_02 AC 453 ms
44,052 KB
testcase_03 AC 445 ms
44,048 KB
testcase_04 AC 454 ms
44,188 KB
testcase_05 AC 447 ms
44,300 KB
testcase_06 AC 465 ms
43,928 KB
testcase_07 AC 445 ms
44,192 KB
testcase_08 AC 446 ms
43,808 KB
testcase_09 AC 443 ms
43,796 KB
testcase_10 AC 444 ms
43,924 KB
testcase_11 AC 450 ms
44,056 KB
testcase_12 AC 444 ms
44,060 KB
testcase_13 AC 452 ms
44,184 KB
testcase_14 AC 448 ms
43,804 KB
testcase_15 AC 450 ms
44,188 KB
testcase_16 AC 453 ms
44,188 KB
testcase_17 AC 452 ms
44,156 KB
testcase_18 AC 447 ms
44,432 KB
testcase_19 AC 456 ms
44,104 KB
testcase_20 AC 448 ms
44,052 KB
testcase_21 AC 446 ms
44,308 KB
testcase_22 TLE -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

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

if N > M or N == 1:
    print(1)
    exit(0)

dp = np.zeros((M + 1), dtype='i')
dp[0] = 1

for i in range(M):
    j = i + N
    if j <= M:
        dp[j] += dp[i]
        dp[j] %= MOD
    dp[i + 1] += dp[i]
    dp[i + 1] %= MOD

print(dp[-1])
0