結果

問題 No.1892 Extended Fib Series
ユーザー ぐぅこぱ
提出日時 2022-04-05 23:06:50
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 838 bytes
コンパイル時間 1,808 ms
コンパイル使用メモリ 169,188 KB
実行使用メモリ 13,768 KB
最終ジャッジ日時 2024-11-27 07:53:08
合計ジャッジ時間 26,151 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 18 TLE * 1
other AC * 9 TLE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const long long INF = 1LL << 60;
const long long  MOD = 1000000007;
//const long long  MOD = 998244353;
long double PI = 3.14159265358979;
typedef long long ll;
using namespace std;

int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

    int n, l;
    cin >> n >> l;

    vector<ll> dp(n+1);
    dp[0] = 1;
    for(int i = 0; i < n; i++){
        for(int j = 1; j <= l; j++){
            if(i + j > n) break;
            dp[i+j] += dp[i];
            dp[i+j] %= MOD;
        }
    }
    cout << dp[n] << endl;
    return 0;          
}
0