算法
Koneeeeeee
这个作者很懒,什么都没留下…
展开
-
【算法】【贪心】621. Task Scheduler
来源:力扣(LeetCode)链接:https://leetcode.cn/problems/task-scheduler著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。转载 2022-08-30 22:35:12 · 105 阅读 · 0 评论 -
【算法】【手撕】207课程表等题
还有210课程表2,以及一道困难的课程表3感觉是和图相关的理论。原创 2022-08-24 14:31:29 · 55 阅读 · 0 评论 -
【算法】【寻路】启发式搜索之a*算法
a star search algorithm是一种静态路网中求解最短路径的高效算法可以看作是bfs的改进原创 2021-08-22 14:17:27 · 1183 阅读 · 1 评论 -
【算法】【笔试】优雅的split方法/从单行输入中获取多个string
注意func1是永远不会跳出的,所以只有有n的时候才能用cin>>直接输入。否则用getline。原创 2022-08-11 00:57:27 · 100 阅读 · 0 评论 -
【笔试】2022/08/11-zoom
对于每个2请求,返回推荐的个数,注意关联集合有传递性。我当时的答案,但是只过了30%原创 2022-08-11 00:42:01 · 96 阅读 · 0 评论 -
【lc】678-有效括号模式
输入一个字符串,仅有3种字符构成(, *, ),其中 * 可以代表左括号或右括号,或空字符请判断字符串是否是有效的括号串,注意,空串属于有效原创 2022-08-05 22:38:04 · 158 阅读 · 0 评论 -
【算法】【dp】【贪心】【二分】300. Longest Increasing Subsequence
太nb了这题Given an integer array nums, return the length of the longest strictly increasing subsequence.A subsequence is a sequence that can be derived from an array by deleting some or no elements without changing the order of the remaining elements. For ex原创 2021-07-09 16:58:44 · 68 阅读 · 0 评论 -
【堆】【数组】378. Kth Smallest Element in a Sorted Matrix
这题乍一看挺妙的,实际没想到暴力也能过。。Given an n x n matrix where each of the rows and columns are sorted in ascending order, return the kth smallest element in the matrix.Note that it is the kth smallest element in the sorted order, not the kth distinct element.题目链接法1原创 2021-07-08 11:12:39 · 71 阅读 · 0 评论 -
1143. Longest Common Subsequence
大概是最最基础的dp?Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0.A subsequence of a string is a new string generated from the original string with some characters (can be non原创 2021-05-22 22:29:12 · 58 阅读 · 0 评论 -
【算法】1442. Count Triplets That Can Form Two Arrays of Equal XOR
https://leetcode-cn.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/Given an array of integers arr.We want to select three indices i, j and k where (0 <= i < j <= k < arr.length).Let’s define a and b as follows:a = arr[i]原创 2021-05-18 21:19:36 · 104 阅读 · 0 评论 -
【算法】1568. 使陆地分离的最少天数
给你一个由若干 0 和 1 组成的二维网格 grid ,其中 0 表示水,而 1 表示陆地。岛屿由水平方向或竖直方向上相邻的 1 (陆地)连接形成。如果 恰好只有一座岛屿 ,则认为陆地是 连通的 ;否则,陆地就是 分离的 。一天内,可以将任何单个陆地单元(1)更改为水单元(0)。返回使陆地分离的最少天数。来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/minimum-number-of-days-to-disconnect-island著作权原创 2020-10-17 12:09:56 · 241 阅读 · 0 评论 -
待做的题
Can Make Arithmetic Progression From SequenceLast Moment Before All Ants Fall Out of a PlankCount Submatrices With All OnesMinimum Possible Integer After at Most K Adjacent Swaps On DigitsNumber of Good PairsBest Position for a Service Centre原创 2020-07-20 16:05:26 · 91 阅读 · 0 评论 -
【算法】236. 二叉树的最近公共祖先
来源Leetcode236. 二叉树的最近公共祖先Lowest Common Ancestor of a Binary Tree原创 2020-06-26 23:14:44 · 184 阅读 · 0 评论