From 0ccbc1ea535240a2118296eaf1d5414c41a865b4 Mon Sep 17 00:00:00 2001 From: jeffreyjia Date: Sun, 12 Mar 2023 13:07:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B00746.=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E8=8A=B1=E8=B4=B9=E7=88=AC=E6=A5=BC=E6=A2=AF?= =?UTF-8?q?.md=20=E6=8F=90=E4=BE=9BGo=E7=89=88=E6=9C=AC=E8=A7=A3=E6=B3=95?= =?UTF-8?q?=E7=9A=84=E6=96=B0=E6=80=9D=E8=B7=AF(dp[i]=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E4=BB=8Ei=E5=B1=82=E8=B5=B7=E8=B7=B3=E6=89=80=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=94=AF=E4=BB=98=E7=9A=84=E6=9C=80=E5=B0=8F=E8=B4=B9?= =?UTF-8?q?=E7=94=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 8 ++++++ .idea/leetcode-master.iml | 9 +++++++ .idea/modules.xml | 8 ++++++ .idea/vcs.xml | 6 +++++ problems/0746.使用最小花费爬楼梯.md | 27 ++++++++++++++++++++ 5 files changed, 58 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/leetcode-master.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..35410cac --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/leetcode-master.iml b/.idea/leetcode-master.iml new file mode 100644 index 00000000..5e764c4f --- /dev/null +++ b/.idea/leetcode-master.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..7c250acd --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/problems/0746.使用最小花费爬楼梯.md b/problems/0746.使用最小花费爬楼梯.md index 44b6406c..d6b3a177 100644 --- a/problems/0746.使用最小花费爬楼梯.md +++ b/problems/0746.使用最小花费爬楼梯.md @@ -284,6 +284,33 @@ func min(a, b int) int { return b } ``` +``` GO +第二种思路: dp[i]表示从i层起跳所需要支付的最小费用 +递推公式: +i