結果

問題 No.1011 Infinite Stairs
ユーザー pluto77pluto77
提出日時 2020-06-14 15:20:34
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 293 ms / 2,000 ms
コード長 245 bytes
コンパイル時間 388 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 77,480 KB
最終ジャッジ日時 2023-09-24 11:18:06
合計ジャッジ時間 4,731 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,308 KB
testcase_01 AC 70 ms
71,524 KB
testcase_02 AC 86 ms
76,356 KB
testcase_03 AC 218 ms
76,840 KB
testcase_04 AC 106 ms
76,920 KB
testcase_05 AC 293 ms
77,480 KB
testcase_06 AC 70 ms
71,324 KB
testcase_07 AC 84 ms
76,196 KB
testcase_08 AC 72 ms
71,520 KB
testcase_09 AC 76 ms
76,128 KB
testcase_10 AC 82 ms
76,208 KB
testcase_11 AC 114 ms
76,816 KB
testcase_12 AC 79 ms
76,172 KB
testcase_13 AC 102 ms
76,336 KB
testcase_14 AC 78 ms
76,156 KB
testcase_15 AC 106 ms
76,612 KB
testcase_16 AC 178 ms
77,316 KB
testcase_17 AC 93 ms
76,348 KB
testcase_18 AC 139 ms
76,920 KB
testcase_19 AC 83 ms
76,300 KB
testcase_20 AC 79 ms
76,164 KB
testcase_21 AC 105 ms
76,412 KB
testcase_22 AC 128 ms
77,004 KB
testcase_23 AC 109 ms
76,392 KB
testcase_24 AC 111 ms
76,476 KB
testcase_25 AC 132 ms
76,932 KB
testcase_26 AC 92 ms
76,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1011
mod=10**9+7
n,d,k=map(int,input().split())
dp=[0]*(k+1)
dp[0]=1
for j in range(n):
 t=0
 for i in dp[max(0,k-d):k]:
  t+=i
  t%=mod
 for i in range(k,-1,-1):
  dp[i]=t
  t-=dp[i-1]
  if i-1-d>=0:
   t+=dp[i-1-d]
  t%=mod
print(dp[-1])
0