結果
問題 |
No.1011 Infinite Stairs
|
ユーザー |
![]() |
提出日時 | 2023-03-27 10:24:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 454 ms / 2,000 ms |
コード長 | 599 bytes |
コンパイル時間 | 1,682 ms |
コンパイル使用メモリ | 172,504 KB |
実行使用メモリ | 215,824 KB |
最終ジャッジ日時 | 2024-09-19 10:08:03 |
合計ジャッジ時間 | 5,923 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define all(v) v.begin(),v.end() using ll = long long; using ull = unsigned long long; using vll=vector<ll>; using vvll = vector<vector<ll>>; ll mod=1e9+7; int main(){ ll N,D,K; cin>>N>>D>>K; vvll dp(N+1,vll(D*N+3)); dp[0][0]=1; vll rw(D*N+3); for(int i=1;i<=N;i++){ for(int j=0;j<=N*D;j++){ rw[j+1]=rw[j]+dp[i-1][j]; } for(int j=1;j<=N*D;j++){ dp[i][j]+=rw[j]-rw[max(0ll,j-D)]; dp[i][j]%=mod; } } cout << dp[N][K] << endl; }