結果

問題 No.1011 Infinite Stairs
ユーザー rinrinta121rinrinta121
提出日時 2020-03-21 13:30:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 347 ms / 2,000 ms
コード長 825 bytes
コンパイル時間 2,055 ms
コンパイル使用メモリ 80,048 KB
実行使用メモリ 215,900 KB
最終ジャッジ日時 2023-09-24 11:05:58
合計ジャッジ時間 3,330 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 8 ms
7,304 KB
testcase_03 AC 231 ms
143,520 KB
testcase_04 AC 44 ms
28,776 KB
testcase_05 AC 347 ms
215,900 KB
testcase_06 AC 2 ms
4,384 KB
testcase_07 AC 6 ms
5,952 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 4 ms
4,732 KB
testcase_11 AC 52 ms
33,328 KB
testcase_12 AC 4 ms
4,388 KB
testcase_13 AC 32 ms
21,660 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 41 ms
27,032 KB
testcase_16 AC 166 ms
102,316 KB
testcase_17 AC 18 ms
13,360 KB
testcase_18 AC 97 ms
60,220 KB
testcase_19 AC 3 ms
4,476 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 39 ms
26,900 KB
testcase_22 AC 79 ms
50,632 KB
testcase_23 AC 48 ms
31,464 KB
testcase_24 AC 52 ms
33,796 KB
testcase_25 AC 84 ms
52,996 KB
testcase_26 AC 20 ms
13,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <stack>
#include <climits>
#include <map>
#include <set>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const ll mod = 1000000007;
const int inf = 1e9;
const long long INF = 1LL << 60;

ll dp[310][90400];

int main()
{
    int n,d,m;
    cin >> n >> d >> m;
    dp[0][0] = 1;
    for(int i = 0; i < n; i++){
        for(int j = 0; j <= m; j++){
            dp[i+1][j+1] += dp[i][j];
            dp[i+1][j+1] %= mod;
            dp[i+1][j+1+d] -= dp[i][j];
            dp[i+1][j+1+d] %= mod;
        }
        for(int j = 0; j <= m; j++){
            dp[i+1][j+1] += dp[i+1][j];
            dp[i][j] %= mod;

        }
    }
    cout << dp[n][m] % mod << endl;
}
0