結果

問題 No.2791 Beginner Contest
ユーザー ニックネームニックネーム
提出日時 2024-06-21 21:41:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 156 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 16,136 KB
最終ジャッジ日時 2024-06-21 21:41:19
合計ジャッジ時間 1,627 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,624 KB
testcase_01 AC 28 ms
10,624 KB
testcase_02 AC 42 ms
12,528 KB
testcase_03 AC 25 ms
10,752 KB
testcase_04 AC 26 ms
10,624 KB
testcase_05 AC 26 ms
10,752 KB
testcase_06 AC 60 ms
14,312 KB
testcase_07 AC 33 ms
11,264 KB
testcase_08 AC 33 ms
11,392 KB
testcase_09 AC 73 ms
15,400 KB
testcase_10 AC 74 ms
15,680 KB
testcase_11 AC 56 ms
13,064 KB
testcase_12 AC 86 ms
16,136 KB
testcase_13 AC 51 ms
12,796 KB
testcase_14 AC 37 ms
11,364 KB
testcase_15 AC 54 ms
12,872 KB
testcase_16 AC 25 ms
10,752 KB
testcase_17 AC 25 ms
10,752 KB
testcase_18 AC 53 ms
13,064 KB
testcase_19 AC 55 ms
13,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
a = [1]+[0]*n; b = [1]+[0]*n
for i in range(1,n+1):
    if i>=k: a[i] = b[i-k]
    b[i] = (b[i-1]+a[i])%998244353
print(b[n])
0