結果
| 問題 |
No.1011 Infinite Stairs
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-20 21:51:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,442 bytes |
| コンパイル時間 | 1,178 ms |
| コンパイル使用メモリ | 99,800 KB |
| 実行使用メモリ | 222,496 KB |
| 最終ジャッジ日時 | 2024-12-15 05:27:08 |
| 合計ジャッジ時間 | 46,602 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 TLE * 15 |
ソースコード
#include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b; return true;
}
return false;
}
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b; return true;
}
return false;
}
#define pb push_back
#define mp make_pair
#define mt make_tuple
ll MOD = 1e9 + 7;
int main(void)
{
cin.sync_with_stdio(false);
ll N, D, K;
cin >> N >> D >> K;
// [行動回数][何段目か]
vector<vector<ll>> dp(N + 1, vector<ll>(K + 1));
dp[0][0] = 1;
REP(n, N) {
REP(k, K) {
FOR(d, 1, D + 1) {
if (k + d <= K) {
dp[n + 1][k + d] += dp[n][k];
dp[n + 1][k + d] %= MOD;
}
}
}
}
// for(auto e: dp[N]) cout << e << " ";
// cout << endl;
cout << dp[N][K] << endl;
return 0;
}