結果

問題 No.2791 Beginner Contest
ユーザー karinohito
提出日時 2024-09-19 21:57:08
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 340 bytes
コンパイル時間 1,710 ms
コンパイル使用メモリ 195,368 KB
最終ジャッジ日時 2025-02-24 09:34:02
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 RE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {

    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    ll N,K,mod=998244353;
    cin>>N>>K;
    vector<ll> SDP(N+1,0);
    for(int i=0;i<K;i++)SDP[i]=1;
    for(int i=K;i<=N;i++){
        SDP[i]=(SDP[i-K]+SDP[i-1])%mod;
    } 
    cout<<SDP[N]<<endl;
}
0