結果
問題 | No.1011 Infinite Stairs |
ユーザー | s_shohei |
提出日時 | 2020-04-26 11:42:13 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 590 bytes |
コンパイル時間 | 1,514 ms |
コンパイル使用メモリ | 86,668 KB |
実行使用メモリ | 76,824 KB |
最終ジャッジ日時 | 2023-08-10 07:23:28 |
合計ジャッジ時間 | 5,784 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 72 ms
71,188 KB |
testcase_01 | AC | 71 ms
71,088 KB |
testcase_02 | AC | 161 ms
76,824 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
ソースコード
n,d,k = map(int, input().split()) dp1=[0]*(d*n+1) dp2=[0]*(d*n+1) dp1[0]=1 for cnt in range(n): if cnt%2==0: dp2=[0]*(d*n+1) else: dp1=[0]*(d*n+1) for i in range(len(dp1)): if cnt%2==0: for j in range(1,d+1): if i+j < len(dp1): dp2[i+j] += dp1[i] dp2[i+j] %= 10**9+7 else: for j in range(1,d+1): if i+j < len(dp1): dp1[i+j] += dp2[i] dp1[i+j] %= 10**9+7 if n%2==0: print(dp1[k]) else: print(dp2[k])