An integer interval [a, b] (for integers a < b) is a set of all consecutive integers from a to b, including a and b. Find the minimum size of a set S ...
分类:
其他好文 时间:
2018-03-04 00:24:15
阅读次数:
381
原版题意:给定一个序列,每次操作给其中一个数$+1$或$-1$,问最少需要多少操作使得整个序列为不下降序列。 题解:不下降序列最后修改完成后的各个数一定是原序列中的某一个数。关于这个的理解看到网上的一个解释:原序列,从左到右扫过去,如果左边的大于右边的,要么左边的减掉使其等于右边的,要么右边的加上使 ...
分类:
其他好文 时间:
2018-03-03 21:28:36
阅读次数:
182
1.将每次n-1个数+1,转化为每次最大的数-1 2.问题的关键是最后的相同值是多少。将数组调整到相同值最快的方法是:将中位数当做相同值。 ...
分类:
其他好文 时间:
2018-03-02 22:06:17
阅读次数:
122
#设置cmake最低版本号 CMAKE_MINIMUM_REQUIRED(VERSION 3.4.0) #设置工程名称 PROJECT(HelloWorld) #设置工程包含当前目录,非必须 SET(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置自动生成moc文件,AUTOMO... ...
分类:
其他好文 时间:
2018-03-02 12:35:27
阅读次数:
209
Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. ...
分类:
其他好文 时间:
2018-03-01 21:38:30
阅读次数:
181
Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string may cont ...
分类:
其他好文 时间:
2018-02-28 10:36:39
阅读次数:
164
Component 组件props 属性设置 ...
分类:
其他好文 时间:
2018-02-28 01:09:35
阅读次数:
168
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. ...
分类:
其他好文 时间:
2018-02-25 17:19:12
阅读次数:
161
https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/description/Suppose an array sorted in ascending order is rotated at some pivot unk... ...
分类:
其他好文 时间:
2018-02-25 13:12:08
阅读次数:
138
伸展树(一)之 图文解析 和 C语言的实现 概要 本章介绍伸展树。它和"二叉查找树"和"AVL树"一样,都是特殊的二叉树。在了解了"二叉查找树"和"AVL树"之后,学习伸展树是一件相当容易的事情。和以往一样,本文会先对伸展树的理论知识进行简单介绍,然后给出C语言的实现。后序再分别给出C++和Java ...
分类:
其他好文 时间:
2018-02-24 15:05:31
阅读次数:
254