結果
問題 |
No.1011 Infinite Stairs
|
ユーザー |
|
提出日時 | 2020-03-27 20:23:31 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 774 bytes |
コンパイル時間 | 1,359 ms |
コンパイル使用メモリ | 156,968 KB |
実行使用メモリ | 480,660 KB |
最終ジャッジ日時 | 2025-01-02 09:19:18 |
合計ジャッジ時間 | 4,274 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; #define MOD 1000000007 /* 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; } cout << dp[N][K] << endl; }