結果
問題 |
No.1011 Infinite Stairs
|
ユーザー |
![]() |
提出日時 | 2020-03-20 22:00:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 482 bytes |
コンパイル時間 | 1,519 ms |
コンパイル使用メモリ | 168,088 KB |
実行使用メモリ | 76,836 KB |
最終ジャッジ日時 | 2024-12-15 05:47:49 |
合計ジャッジ時間 | 25,021 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 TLE * 5 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll dp[301][90001]; //dp[i][j]:=i回目の移動後、j段目にいる場合の数 const int MOD=1e9+7; int main(){ int n,d,k; cin >> n >> d >> k; dp[0][0]=1; for(int i=1;i<=n;i++){ for(int j=0;j<k;j++){ for(int l=1;l<=d;l++){ dp[i][j+l]+=dp[i-1][j]; dp[i][j+l]%=MOD; } } } cout << dp[n][k] << endl; return 0; }