結果

問題 No.1011 Infinite Stairs
コンテスト
ユーザー kt_deeea
提出日時 2020-03-20 22:14:43
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 634 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 889 ms
コンパイル使用メモリ 184,480 KB
実行使用メモリ 16,200 KB
最終ジャッジ日時 2026-05-25 19:23:55
合計ジャッジ時間 4,637 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other TLE * 1 -- * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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;
}
0