結果
問題 |
No.1892 Extended Fib Series
|
ユーザー |
![]() |
提出日時 | 2022-04-05 23:04:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 838 bytes |
コンパイル時間 | 1,739 ms |
コンパイル使用メモリ | 194,672 KB |
最終ジャッジ日時 | 2025-01-28 15:20:50 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 18 TLE * 1 |
other | AC * 9 TLE * 5 |
ソースコード
#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; }