結果
問題 |
No.2791 Beginner Contest
|
ユーザー |
|
提出日時 | 2024-06-27 01:03:56 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 505 bytes |
コンパイル時間 | 5,389 ms |
コンパイル使用メモリ | 308,808 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 01:04:03 |
合計ジャッジ時間 | 6,169 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include <bits/stdc++.h> using namespace std; #include<atcoder/all> using namespace atcoder; typedef long long ll; typedef pair<ll,ll> pll; typedef modint998244353 mint; #define rep(i,n) for(ll i=0;i<n;i++) #define chmin(a,b) a=min(a,b) #define chmax(a,b) a=max(a,b) #define all(a) a.begin(),a.end() const int INF=1001001001; int main(){ int n,k; cin>>n>>k; vector<mint>dp(n+2); dp[0]=1; for(int i=1;i<=n;i++){ dp[i]+=dp[i-1]; if(i-k>=0)dp[i]+=dp[i-k]; } cout<<dp[n].val()<<endl; }