/images/avatar.jpg

草祭の博客

English Dictation 01

题记

想随便练练英语听力吧,刚好找到一个挺有趣的教英语的老师,他的视频挺不错的。打算做个系列文章稍微简单地记录一下,文章结构就用第一次听写 + 原文 的形式

并查集

题记

今天上了数理统计和数学模型与优化,感觉终于上到了我认为的好课。第一眼看到数学模型与优化的董文永老师感觉自带气场,带着帽子上课,不过讲课还是挺幽默的。非常想吐槽一下教室的设备,两个教室的麦克风完全没声音,幸好坐在前排,要是抢不到位置估计很难听到吧(或者是我带耳机久了,听力下降了吗)。

回溯算法初探

概念

类似穷举的方法,不断搜索可能解的路径,当发现不满足的条件时,就回溯返回,返回后再继续尝试别的路径。

(如下图示, 为了找到迷宫的出口,不断尝试不同的路径,当发现路径不通时,回溯到岔路口,并继续走其他路径)

每日Leetcode03

39. Combination Sum

tag. array

Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target.

The same repeated number may be chosen from candidates unlimited number of times.

Example 1:

Input: candidates = [2,3,6,7], target = 7,
A solution set is:
[
  [7],
  [2,2,3]
]

Solution来源:https://leetcode-cn.com/problems/combination-sum/solution/xue-yi-tao-zou-tian-xia-hui-su-suan-fa-by-powcai/