結果
問題 |
No.1011 Infinite Stairs
|
ユーザー |
![]() |
提出日時 | 2020-03-20 22:14:43 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 634 bytes |
コンパイル時間 | 1,661 ms |
コンパイル使用メモリ | 166,096 KB |
実行使用メモリ | 77,216 KB |
最終ジャッジ日時 | 2024-12-15 06:18:58 |
合計ジャッジ時間 | 24,916 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 TLE * 5 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll dp[301][90001]; //dp[i][j]:=i回目の移動後、j段目にいる場合の数 const int MOD=1e9+7; int main(){ int n,d,k; cin >> n >> d >> k; dp[0][0]=1; for(int i=1;i<=n;i++){ for(int j=0;j<=k-n;j++){ for(int l=0;l<d;l++){ dp[i][j+l]+=dp[i-1][j]; dp[i][j+l]%=MOD; } } } // for(int i=1;i<=n;i++){ // for(int j=0;j<=k-n;j++){ // cout << dp[i][j] << " "; // } // cout << endl; // } cout << dp[n][k-n] << endl; return 0; }