- 博客(8)
- 资源 (2)
- 收藏
- 关注
原创 x的平方根
实现int sqrt(int x)函数,计算并返回x的平方根。样例sqrt(3) = 1sqrt(4) = 2sqrt(5) = 2sqrt(10) = 3class Solution {public: /** * @param x: An integer * @return: The sqrt of x
2022-12-30 16:48:09 623 1
原创 分糖果问题
有N个小孩站成一列。每个小孩有一个评级。按照以下要求,给小孩分糖果:每个小孩至少得到一颗糖果。相邻小孩之间,评级越高的小孩可以得到更多的糖果。需最少准备多少糖果?class Solution {public: /** * @param ratings Children's ratings * @return the minimum
2022-12-30 16:46:54 349 1
原创 使用mybatis存储一条数据后返回自增主键的值
对于要存储的数据,有一个bean,bean中包含了自增主键id:public class realBean{ private int id; private String name; public realBean() { super(); } public realBean(String name) { this....
2018-09-10 10:33:08 673
转载 QT导出excel
在Qt中使用QAxObject类访问Com组件对象,需要在pro文件中添加下面的内容:QT +=axcontainer bool exportexcel(){ QString filePath = "test.xlsx"; QAxObject * work_book; QAxObject excel("Excel.Applicatio...
2018-04-12 13:18:58 789
原创 C++大楼轮廓
水平面上有 N 座大楼,每座大楼都是矩阵的形状,可以用三个数字表示(start, end, height),分别代表其在x轴上的起点,终点和高度。大楼之间从远处看可能会重叠,求出 N 座大楼的外轮廓线。外轮廓线的表示方法为若干三元组,每个三元组包含三个数字 (start, end, height),代表这段轮廓的起始位置,终止位置和高度。例如:给
2016-12-13 11:45:17 720
原创 Intersection of Two Arrays II 两数组的交
Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Note:Each element in the result should appear as ma
2016-12-12 14:44:11 266
原创 Intersection of Two Arrays 两数组的交
Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Note:Each element in the result must be unique.The res
2016-12-12 13:40:44 227
原创 接雨水问题(C++)
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,
2016-12-08 16:59:17 2015
gnu-make.pdf
2018-02-09
corebook.pdf
2018-02-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人