結果
| 問題 |
No.1011 Infinite Stairs
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-20 21:46:19 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 503 bytes |
| コンパイル時間 | 628 ms |
| コンパイル使用メモリ | 123,520 KB |
| 実行使用メモリ | 116,384 KB |
| 最終ジャッジ日時 | 2024-11-30 16:58:26 |
| 合計ジャッジ時間 | 28,269 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 TLE * 5 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
const int MOD = 1000000007;
int main() {
int n,d,k;
cin >> n >> d >> k;
vector<vector<int>> dp(n+1, vector<int>(k+1, 0));
dp[0][0] = 1;
for (int i=0; i<n; i++) {
for (int j=0; j<=k; j++) {
for (int l=1; l<=d; l++) {
if (j + l > k) continue;
dp[i+1][j+l] += dp[i][j];
dp[i+1][j+l] %= MOD;
}
}
}
cout << dp[n][k] << endl;
}