結果
問題 | No.1011 Infinite Stairs |
ユーザー | rinrinta121 |
提出日時 | 2020-03-21 13:19:49 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 782 bytes |
コンパイル時間 | 655 ms |
コンパイル使用メモリ | 80,108 KB |
実行使用メモリ | 215,936 KB |
最終ジャッジ日時 | 2023-08-23 12:34:34 |
合計ジャッジ時間 | 3,314 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,460 KB |
testcase_01 | AC | 2 ms
7,400 KB |
testcase_02 | AC | 28 ms
107,520 KB |
testcase_03 | AC | 146 ms
175,148 KB |
testcase_04 | AC | 49 ms
119,200 KB |
testcase_05 | WA | - |
testcase_06 | AC | 2 ms
4,376 KB |
testcase_07 | AC | 24 ms
99,952 KB |
testcase_08 | AC | 1 ms
4,376 KB |
testcase_09 | AC | 2 ms
5,596 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 34 ms
100,572 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 9 ms
40,252 KB |
testcase_20 | AC | 7 ms
38,144 KB |
testcase_21 | AC | 35 ms
96,136 KB |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | AC | 71 ms
135,588 KB |
testcase_26 | AC | 22 ms
67,124 KB |
ソースコード
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> #include <stdio.h> #include <queue> #include <stack> #include <climits> #include <map> #include <set> using namespace std; typedef long long ll; typedef pair<int, int> P; const ll mod = 1000000007; const int inf = 1e9; const long long INF = 1LL << 60; ll dp[310][90400]; int main() { int n,d,m; cin >> n >> d >> m; dp[0][0] = 1; for(int i = 0; i <= n; i++){ for(int j = 0; j <= m; j++){ dp[i+1][j+1] += dp[i][j]; dp[i+1][j+1+d] -= dp[i][j]; } for(int j = 0; j <= m; j++){ dp[i+1][j+1] += dp[i+1][j]; dp[i+1][j+1] %= mod; } } cout << dp[n][m] << endl;; }