結果

問題 No.1011 Infinite Stairs
ユーザー trineutron
提出日時 2020-03-21 00:46:28
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 543 bytes
コンパイル時間 1,916 ms
コンパイル使用メモリ 197,056 KB
最終ジャッジ日時 2025-01-09 08:53:27
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 TLE * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    const int64_t mod = 1000000007;
    int n, d, k;
    cin >> n >> d >> k;
    vector<vector<int64_t>> dp(k + 1, vector<int64_t>(n + 1));
    dp.at(0).at(0) = 1;
    for (int i = 1; i <= k; i++) {
        for (int j = 1; j <= d; j++) {
            for (int l = 1; l <= n; l++) {
                if (i < j) continue;
                dp.at(i).at(l) += dp.at(i - j).at(l - 1);
                dp.at(i).at(l) %= mod;
            }
        }
    }
    cout << dp.at(k).at(n) << endl;
}
0