結果

問題 No.1011 Infinite Stairs
ユーザー eQeeQe
提出日時 2020-03-27 20:21:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 761 bytes
コンパイル時間 1,749 ms
コンパイル使用メモリ 199,036 KB
実行使用メモリ 516,716 KB
最終ジャッジ日時 2023-08-30 16:47:09
合計ジャッジ時間 4,629 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#include <string>
#define ft first
#define sc second
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) (a)=(a>b)?(a):(b);
#define chmin(a, b) (a)=(a<b)?(a):(b);
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PL;
static const ll INF=1e18;
static const ll MAX=101010;
static const ll MOD=1e9+7;


/*
 for(i=0; i<N; i++)
   cin >> a[i];
*/

ll dp[333][333*333];
ll s[333][333*333];

int main(void) {
  ll i, j, k;
  
  ll N, D, K;
  cin >> N >> D >> K;
  
  dp[0][0]=1;
  s[0][0]=1;
  for(i=0; i<N; i++) {
    for(j=1; j<=K; j++) s[i][j]=(s[i][j-1]+dp[i][j])%MOD;
    
    for(j=1; j<=K; j++)
      dp[i+1][j]=(s[i][j-1]-s[i][j-D-1]+MOD)%MOD;
  }
  
  pt(dp[N][K]);
  
}


0