結果
| 問題 |
No.1011 Infinite Stairs
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-27 20:19:12 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 761 bytes |
| コンパイル時間 | 1,556 ms |
| コンパイル使用メモリ | 160,408 KB |
| 実行使用メモリ | 466,244 KB |
| 最終ジャッジ日時 | 2025-01-02 09:18:08 |
| 合計ジャッジ時間 | 4,865 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 3 WA * 21 |
ソースコード
#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]);
}