結果

問題 No.1892 Extended Fib Series
ユーザー ぐぅこぱぐぅこぱ
提出日時 2022-04-05 23:06:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 838 bytes
コンパイル時間 1,581 ms
コンパイル使用メモリ 168,976 KB
実行使用メモリ 13,760 KB
最終ジャッジ日時 2024-05-05 11:21:17
合計ジャッジ時間 5,033 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
13,760 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

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