結果
問題 | No.2791 Beginner Contest |
ユーザー |
|
提出日時 | 2024-07-03 02:27:35 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 455 bytes |
コンパイル時間 | 3,865 ms |
コンパイル使用メモリ | 246,504 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-03 02:27:41 |
合計ジャッジ時間 | 4,387 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 WA * 1 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; const ll mod = 998244353; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); fixed(cout).precision(12); ll N, K; cin >> N >> K; vector<ll> dp(N + 1, 0); dp[0] = 1; for(int i = 1; i <= N; i++) if(i - K >= 0) dp[i] = (dp[i - K] + dp[i - 1]) % mod; ll ans = 0; for(auto a: dp) (ans += a) %= mod; cout << ans << endl; }