結果

問題 No.2791 Beginner Contest
ユーザー karinohitokarinohito
提出日時 2024-09-19 21:57:08
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 340 bytes
コンパイル時間 1,853 ms
コンパイル使用メモリ 201,736 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-19 21:57:13
合計ジャッジ時間 3,603 ms
ジャッジサーバー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