結果
問題 | No.1011 Infinite Stairs |
ユーザー | ktr216 |
提出日時 | 2020-03-20 21:58:01 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 572 bytes |
コンパイル時間 | 1,714 ms |
コンパイル使用メモリ | 168,452 KB |
実行使用メモリ | 147,852 KB |
最終ジャッジ日時 | 2023-08-21 16:28:14 |
合計ジャッジ時間 | 5,234 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
8,760 KB |
testcase_01 | AC | 1 ms
4,376 KB |
testcase_02 | AC | 17 ms
5,996 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
ソースコード
#include "bits/stdc++.h" #define rep(i,n) for(int i=0;i<n;i++) using namespace std; typedef long long ll; int main() { ll N, d, K, MOD =1e9 + 7; cin >> N >> d >> K; //dp[i][j] : i回の移動でj段目にたどり着く方法 vector<vector<ll>> dp(N + 1, vector<ll>(K + 1, 0)); dp[0][0] = 1; rep(i, N) { rep(j, K) { rep(k, d) { if (j + k + 1 > K) break; dp[i + 1][j + k + 1] += dp[i][j]; dp[i + 1][j + k + 1] %= MOD; } } } cout << dp[N][K] << "\n"; }