結果
| 問題 | No.1011 Infinite Stairs |
| コンテスト | |
| ユーザー |
nagitaosu
|
| 提出日時 | 2020-03-20 21:53:06 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 584 bytes |
| 記録 | |
| コンパイル時間 | 421 ms |
| コンパイル使用メモリ | 87,524 KB |
| 実行使用メモリ | 43,264 KB |
| 最終ジャッジ日時 | 2026-05-25 18:48:59 |
| 合計ジャッジ時間 | 7,535 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 TLE * 2 -- * 21 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
constexpr int MOD = 1e9 + 7;
int dp[301][90001];
int main(){
int n, d, k; cin >> n >> d >> k;
dp[0][0] = 1;
for(int i = 0; i < n; ++i){
for(int j = 0; j < k; ++j){
if(dp[i][j] == 0){ continue; }
for(int step=1; step < d + 1; ++step){
if(j + step < k + 1){
dp[i+1][j+step] += dp[i][j];
dp[i+1][j+step] %= MOD;
}
}
}
}
cout << dp[n][k] << endl;
return 0;
}
nagitaosu