基本原理就不做介绍了, 很基础的数据结构课程知识.私下回顾即可,主要学习代码. 1.双指针 https://leetcode-cn.com/problems/two-sum-ii-input-array-is-sorted/description/?utm_source=LCUS&utm_mediu ...
分类:
编程语言 时间:
2020-03-15 13:20:39
阅读次数:
70
The next lecture in a high school requires two topics to be discussed. The ii-th topic is interesting by aiaiunits for the teacher and by bibi units f ...
分类:
其他好文 时间:
2020-03-14 23:59:09
阅读次数:
158
You are given some Tetris field consisting of nn columns. The initial height of the ii-th column of the field is aiai blocks. On top of these columns ...
分类:
其他好文 时间:
2020-03-14 23:53:35
阅读次数:
75
现在你总共有 n 门课需要选,记为 0 到 n-1。 在选修某些课程之前需要一些先修课程。 例如,想要学习课程 0 ,你需要先完成课程 1 ,我们用一个匹配来表示他们: [0,1] 给定课程总量以及它们的先决条件,返回你为了学完所有课程所安排的学习顺序。 可能会有多个正确的顺序,你只要返回一种就可以 ...
分类:
其他好文 时间:
2020-03-14 14:43:58
阅读次数:
48
Q:给出一个字符串s,分割s使得分割出的每一个子串都是回文串 计算将字符串s分割成回文分割结果的最小切割数 例如:给定字符串s="aab", 返回1,因为回文分割结果["aa","b"]是切割一次生成的。 A: 动态规划问题。 cut[i] 表示子串(0,i)的最小回文切割,则最优解在cut[s.l ...
分类:
其他好文 时间:
2020-03-13 18:59:48
阅读次数:
57
链接:https://leetcode cn.com/problems/dui lie de zui da zhi lcof/ 代码 ...
分类:
其他好文 时间:
2020-03-12 22:03:55
阅读次数:
78
There is a room with n lights which are turned on initially and 4 buttons on the wall. After performing exactly m unknown operations towards buttons, ...
分类:
其他好文 时间:
2020-03-12 14:11:04
阅读次数:
77
课程表二。题意跟207题几乎一样,要求返回你为了学完所有课程所安排的学习顺序。可能会有多个正确的顺序,你只要返回一种就可以了。如果不可能完成所有课程,返回一个空数组。例子, Example 1: Input: 2, [[1,0]] Output: [0,1] Explanation: There a ...
分类:
其他好文 时间:
2020-03-12 11:34:36
阅读次数:
51
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6638 There are nn pirate chests buried in Byteland, labeled by 1,2,…,n1,2,…,n. The ii-th chest's locati ...
分类:
其他好文 时间:
2020-03-12 11:25:40
阅读次数:
49
CF Educational 83 A.数学 给定n,m,问你能否用一个正n边形的m个顶点,使之连成一个正m边形 判断n/m m==n即可 B.构造 给定序列A 使得ii 1,或者跳过第i次操作 问你能否在任意次操作后,使得这个全0序列变成给定序列 思路:把给定的n个非零数,按照k进制分解储存,只要 ...
分类:
其他好文 时间:
2020-03-11 12:43:05
阅读次数:
43