結果

問題 No.1011 Infinite Stairs
ユーザー ktr216ktr216
提出日時 2020-03-20 21:56:29
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 530 bytes
コンパイル時間 1,584 ms
コンパイル使用メモリ 168,700 KB
実行使用メモリ 147,648 KB
最終ジャッジ日時 2023-08-21 16:23:52
合計ジャッジ時間 5,732 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,756 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

typedef long long ll;

int main() {
    ll N, d, K, MOD =1e9 + 7;
    cin >> N >> d >> K;
    //dp[i][j] : i回の移動でj段目にたどり着く方法
    vector<vector<ll>> dp(N + 1, vector<ll>(K + 1, 0));
    dp[0][0] = 1;
    rep(i, N) {
        rep(j, K) {
            rep(k, d) {
                dp[i + 1][j + k + 1] += dp[i][j];
                dp[i + 1][j + k + 1] %= MOD;
            }
        }
    }
    cout << dp[N][K] << "\n";
}
0