結果
| 問題 | No.1892 Extended Fib Series |
| ユーザー |
eSeF
|
| 提出日時 | 2022-04-05 23:18:10 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 375 bytes |
| 記録 | |
| コンパイル時間 | 6,409 ms |
| コンパイル使用メモリ | 309,248 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-27 08:14:02 |
| 合計ジャッジ時間 | 5,788 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 19 |
| other | AC * 14 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using mint = modint1000000007;
int main(){
int N, L;
cin >> N >> L;
vector<mint>dp(N+1, 0);
dp[0] = 1;
for(int i=1;i<=N;i++){
dp[i] = 2 * dp[i-1];
if(i > L) dp[i] -= dp[i-1-L];
}
cout << (dp[N] - dp[N-1]).val() << endl;
return 0;
}
eSeF