結果
問題 |
No.1892 Extended Fib Series
|
ユーザー |
![]() |
提出日時 | 2022-10-07 09:25:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 366 bytes |
コンパイル時間 | 1,538 ms |
コンパイル使用メモリ | 167,244 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-06-11 17:10:35 |
合計ジャッジ時間 | 5,220 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 19 |
other | AC * 1 TLE * 1 -- * 12 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int n,l; cin>>n>>l; const ll mod=1e9+7; ll dp[n+1]; dp[0]=1; dp[1]=1; for(int i=2;i<=n;i++){ dp[i]=0; for(int j=1;j<=l;j++){ if(i-j<0)break; dp[i]+=dp[i-j]; dp[i]%=mod; } } cout<<dp[n]<<endl; }