結果
問題 |
No.1011 Infinite Stairs
|
ユーザー |
|
提出日時 | 2020-03-20 22:25:06 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 566 bytes |
コンパイル時間 | 579 ms |
コンパイル使用メモリ | 121,344 KB |
実行使用メモリ | 221,056 KB |
最終ジャッジ日時 | 2024-11-30 17:00:29 |
合計ジャッジ時間 | 29,328 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 TLE * 6 |
ソースコード
#include <iostream> #include <vector> using namespace std; using int64 = long long; const int MOD = 1000000007; int main() { int n,d,k; cin >> n >> d >> k; vector<vector<int64>> dp(n+1, vector<int64>(k+1, 0)); dp[0][0] = 1; for (int i=0; i<n; i++) { for (int j=i; j<=(i*d)+d; j++) { for (int l=1; l<=d; l++) { if (j + l > k) continue; if (dp[i+1][j+l] >= MOD) dp[i+1][j+l] %= MOD; dp[i+1][j+l] += dp[i][j]; } } } cout << dp[n][k] % MOD << endl; }