結果
| 問題 | No.1011 Infinite Stairs |
| コンテスト | |
| ユーザー |
merom686
|
| 提出日時 | 2020-03-20 21:48:59 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 579 bytes |
| 記録 | |
| コンパイル時間 | 400 ms |
| コンパイル使用メモリ | 93,524 KB |
| 実行使用メモリ | 9,904 KB |
| 最終ジャッジ日時 | 2026-10-03 21:15:46 |
| 合計ジャッジ時間 | 13,130 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 TLE * 1 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;
constexpr int P = 1000000007;
int main() {
int n, d, k;
cin >> n >> d >> k;
int dp[90001] = {};
dp[0] = 1;
for (int i = 0; i < n; i++) {
for (int j = k; j >= 0; j--) {
ll t = 0;
for (int h = max(j - d, 0); h < j; h++) {
t += dp[h];
}
dp[j] = t % P;
}
}
cout << dp[k] << endl;
return 0;
}
merom686