From 54847a181cfd59d8e938aa619daf72307a50ac39 Mon Sep 17 00:00:00 2001 From: GODVvVZzz <2662446324@qq.com> Date: Fri, 3 Mar 2023 10:57:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=94=99=E5=88=AB?= =?UTF-8?q?=E5=AD=97-=E6=9F=A5=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/周总结/20210114动规周末总结.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/周总结/20210114动规周末总结.md b/problems/周总结/20210114动规周末总结.md index 039f3596..f47925fe 100644 --- a/problems/周总结/20210114动规周末总结.md +++ b/problems/周总结/20210114动规周末总结.md @@ -117,7 +117,7 @@ for (int i = 3; i <= n ; i++) { 其实可以模拟一下哈,拆分j的情况,在遍历j的过程中dp[i - j]其实都计算过了。 -例如 i= 10,j = 5,i-j = 5,如果把j查分为 2 和 3,其实在j = 2 的时候,i-j= 8 ,拆分i-j的时候就可以拆出来一个3了。 +例如 i= 10,j = 5,i-j = 5,如果把j拆分为 2 和 3,其实在j = 2 的时候,i-j= 8 ,拆分i-j的时候就可以拆出来一个3了。 **或者也可以理解j是拆分i的第一个整数**。 From 419e67ca91122f505f937e774d41bfd1a8c60246 Mon Sep 17 00:00:00 2001 From: Yuhao Ju Date: Fri, 3 Mar 2023 23:26:04 +0800 Subject: [PATCH 2/3] =?UTF-8?q?update=200416.=E5=88=86=E5=89=B2=E7=AD=89?= =?UTF-8?q?=E5=92=8C=E5=AD=90=E9=9B=86=EF=BC=9A=E4=BF=AE=E6=94=B9=20python?= =?UTF-8?q?=20=E4=BB=A3=E7=A0=81=E4=B8=AD=E4=B8=80=E7=BB=B4=E8=83=8C?= =?UTF-8?q?=E5=8C=85=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0416.分割等和子集.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/0416.分割等和子集.md b/problems/0416.分割等和子集.md index 45dd289a..dfb327ec 100644 --- a/problems/0416.分割等和子集.md +++ b/problems/0416.分割等和子集.md @@ -302,7 +302,7 @@ class Solution: target = sum(nums) if target % 2 == 1: return False target //= 2 - dp = [0] * (len(nums) + 1) + dp = [0] * (target + 1) for i in range(len(nums)): for j in range(target, nums[i] - 1, -1): dp[j] = max(dp[j], dp[j - nums[i]] + nums[i]) From 511381119d8228de09c2fb57a3b4c3ce0163bee5 Mon Sep 17 00:00:00 2001 From: life <13122192336@163.com> Date: Sat, 4 Mar 2023 18:30:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=8F=98=E9=87=8F?= =?UTF-8?q?=EF=BC=8C=E4=B8=8A=E9=9D=A2=E9=83=BD=E6=98=AFresSet=E4=B8=8B?= =?UTF-8?q?=E9=9D=A2=E5=86=99=E6=88=90=E4=BA=86setRes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0349.两个数组的交集.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/problems/0349.两个数组的交集.md b/problems/0349.两个数组的交集.md index ed6a5d97..347d1094 100644 --- a/problems/0349.两个数组的交集.md +++ b/problems/0349.两个数组的交集.md @@ -143,9 +143,9 @@ class Solution { return resSet.stream().mapToInt(x -> x).toArray(); //方法2:另外申请一个数组存放setRes中的元素,最后返回数组 - int[] arr = new int[setRes.size()]; + int[] arr = new int[resSet.size()]; int j = 0; - for(int i : setRes){ + for(int i : resSet){ arr[j++] = i; }