結果

問題 No.1011 Infinite Stairs
ユーザー rinrinta121
提出日時 2020-03-21 13:19:49
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 782 bytes
コンパイル時間 770 ms
コンパイル使用メモリ 82,092 KB
実行使用メモリ 216,064 KB
最終ジャッジ日時 2024-12-21 15:33:43
合計ジャッジ時間 3,117 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 12
権限があれば一括ダウンロードができます

ソースコード

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+d] -= dp[i][j];
            
        }
        for(int j = 0; j <= m; j++){
            dp[i+1][j+1] += dp[i+1][j];
            dp[i+1][j+1] %= mod;
            
        }
    }
    cout << dp[n][m] << endl;;
}
0