結果

問題 No.2791 Beginner Contest
ユーザー sawfish
提出日時 2025-04-28 12:29:33
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 455 bytes
コンパイル時間 3,562 ms
コンパイル使用メモリ 127,232 KB
実行使用メモリ 16,064 KB
最終ジャッジ日時 2025-04-28 12:29:41
合計ジャッジ時間 7,291 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 TLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;
using LL = long long;

constexpr LL MOD = 998244353;
LL dp[100001];

int main() {
    int N, K;
    cin >> N >> K;

    dp[0] = 1;
    for (int i = 0; i < N; i++) {
        for (int j = K; j <= N - i; j++) {
            dp[i + j] += dp[i];
            dp[i + j] %= MOD;
        }
    }

    LL ans = 0;
    for (int i = 0; i <= N; i++) {
        ans += dp[i];
        ans %= MOD;
    }

    cout << ans << endl;
}
0