結果

問題 No.1011 Infinite Stairs
ユーザー googol_S0googol_S0
提出日時 2020-06-02 15:55:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 569 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 430 ms
コンパイル使用メモリ 86,848 KB
実行使用メモリ 289,040 KB
最終ジャッジ日時 2023-09-24 11:16:04
合計ジャッジ時間 5,709 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,484 KB
testcase_01 AC 77 ms
71,532 KB
testcase_02 AC 92 ms
76,744 KB
testcase_03 AC 385 ms
214,980 KB
testcase_04 AC 139 ms
93,252 KB
testcase_05 AC 569 ms
289,040 KB
testcase_06 AC 72 ms
71,544 KB
testcase_07 AC 90 ms
76,336 KB
testcase_08 AC 74 ms
71,124 KB
testcase_09 AC 81 ms
76,180 KB
testcase_10 AC 89 ms
76,332 KB
testcase_11 AC 146 ms
93,188 KB
testcase_12 AC 89 ms
76,348 KB
testcase_13 AC 128 ms
92,560 KB
testcase_14 AC 82 ms
76,188 KB
testcase_15 AC 135 ms
93,212 KB
testcase_16 AC 293 ms
173,420 KB
testcase_17 AC 108 ms
84,524 KB
testcase_18 AC 206 ms
132,084 KB
testcase_19 AC 88 ms
76,036 KB
testcase_20 AC 81 ms
76,264 KB
testcase_21 AC 138 ms
98,924 KB
testcase_22 AC 188 ms
121,848 KB
testcase_23 AC 145 ms
103,400 KB
testcase_24 AC 148 ms
105,812 KB
testcase_25 AC 194 ms
124,612 KB
testcase_26 AC 112 ms
86,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D,K=map(int,input().split())
K-=N
D-=1
DP=[[0]*(K+1) for i in range(N+1)]
DP[0][0]=1
mod=10**9+7
def f(x,y):
  global DP
  if y<0:
    return 0
  else:
    return DP[x][y]

for i in range(N):
  for j in range(K+1):
    DP[i+1][j]=(f(i+1,j-1)+DP[i][j]-f(i,j-1-D))%mod
print(DP[N][K])
0