結果

問題 No.1011 Infinite Stairs
ユーザー merom686
提出日時 2020-03-20 21:48:59
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 579 bytes
コンパイル時間 1,038 ms
コンパイル使用メモリ 74,084 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-12-15 05:21:33
合計ジャッジ時間 14,174 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

constexpr int P = 1000000007;

int main() {
    int n, d, k;
    cin >> n >> d >> k;

    int dp[90001] = {};
    dp[0] = 1;

    for (int i = 0; i < n; i++) {
        for (int j = k; j >= 0; j--) {
            ll t = 0;
            for (int h = max(j - d, 0); h < j; h++) {
                t += dp[h];
            }
            dp[j] = t % P;
        }
    }

    cout << dp[k] << endl;

    return 0;
}
0