結果
問題 |
No.1011 Infinite Stairs
|
ユーザー |
|
提出日時 | 2020-03-20 22:09:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 521 bytes |
コンパイル時間 | 1,951 ms |
コンパイル使用メモリ | 177,180 KB |
実行使用メモリ | 224,672 KB |
最終ジャッジ日時 | 2024-12-15 06:07:24 |
合計ジャッジ時間 | 46,043 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 TLE * 15 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++) ll mod = 1e9+7; ll n, d, k; vector<vector<ll>> v; int main(){ cin >> n >> d >> k; v.resize(k+1, vector<ll>(n+1, 0)); v[0][0] = 1; rep(i, 0, k){ rep(j, i+1, min(i+d+1,k+1)){ rep(l, 0, n){ v[j][l+1] += v[i][l]; v[j][l+1] %= mod; } } } cout << v[k][n]%mod << endl; return 0; }