随笔分类 -  c/c++

【leetcode_easy_array】1413. Minimum Value to Get Positive Step by Step Sum
摘要:problem 1413. Minimum Value to Get Positive Step by Step Sum solution #1: 按步骤一步步计算求解; code: solution #2: 推演数学逻辑; 1. 能够推导求解背后的逻辑过程; 2. 确定最大值还是最小值; 3. 记 阅读全文

posted @ 2020-07-15 22:26 鹅要长大 阅读(96) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1217. Play with Chips
摘要:problem 1217. Play with Chips 参考 1. leetcode_1217. Play with Chips; 完 阅读全文

posted @ 2020-07-15 22:25 鹅要长大 阅读(134) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1365. How Many Numbers Are Smaller Than the Current Number
摘要:problem 1365. How Many Numbers Are Smaller Than the Current Number 理解清楚题意,以及计算过程; solution1: two vector; code solution2: one vector; code 注意 1. 累加和的计算 阅读全文

posted @ 2020-07-15 22:22 鹅要长大 阅读(95) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1380. Lucky Numbers in a Matrix
摘要:problem 1380. Lucky Numbers in a Matrix 在矩阵中,如果一个数既是它所在行的最小值,又是它所在列的最大值,则称这个数为幸运数。找到矩阵中所有的幸运数。 Constraints All elements in the matrix are distinct. so 阅读全文

posted @ 2020-07-15 22:09 鹅要长大 阅读(120) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1185. Day of the Week
摘要:problem 1185. Day of the Week 参考 1. leetcode_1185. Day of the Week; 完 阅读全文

posted @ 2020-07-15 22:03 鹅要长大 阅读(188) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1394. Find Lucky Integer in an Array
摘要:problem 1394. Find Lucky Integer in an Array solution #1: 使用哈希表; 使用哈希表记录数组元素和freq,然后判断是否相等,且取最大值; 注意 1. 最大值可以由下标一次递减隐性表示; 2. 数值的范围是1-500; 参考 1. leetco 阅读全文

posted @ 2020-07-15 21:57 鹅要长大 阅读(92) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1385. Find the Distance Value Between Two Arrays
摘要:problem 1385. Find the Distance Value Between Two Arrays 参考 1. leetcode_1385. Find the Distance Value Between Two Arrays; 完 阅读全文

posted @ 2020-07-15 21:55 鹅要长大 阅读(105) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1389. Create Target Array in the Given Order
摘要:problem 1389. Create Target Array in the Given Order 注意理解题意,博主看完example才明白题意,就是在index处插入nums; solution #1: code 参考 1. leetcode_1389. Create Target Arr 阅读全文

posted @ 2020-07-15 21:39 鹅要长大 阅读(125) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1184. Distance Between Bus Stops
摘要:problem 1184. Distance Between Bus Stops solution1: 计算之间的路径; solution2: 计算两部分路径; 注意: 1. 站台的顺序; 2. 计算不同站台之间距离的下标值的确定; 3. 两部分计算结果的最小值为所求解的; 参考 1. leetco 阅读全文

posted @ 2020-07-14 23:04 鹅要长大 阅读(136) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1346. Check If N and Its Double Exist
摘要:problem 1346. Check If N and Its Double Exist solution1: 参考 1. leetcode_1346. Check If N and Its Double Exist; 完 阅读全文

posted @ 2020-07-14 23:01 鹅要长大 阅读(89) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1304. Find N Unique Integers Sum up to Zero
摘要:problem 1304. Find N Unique Integers Sum up to Zero 不知道为什么会有这样的题目,答案也是有多种多样的; solution1: 等差数列; code solution2: 添加正负和零; code solution3: 左右两端添加; code 参考 阅读全文

posted @ 2020-07-14 22:59 鹅要长大 阅读(104) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1200. Minimum Absolute Difference
摘要:problem 1200. Minimum Absolute Difference solution1: two loop; solution2: one loop; 参考 1. leetcode_1200. Minimum Absolute Difference; 完 阅读全文

posted @ 2020-07-14 22:50 鹅要长大 阅读(102) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1313. Decompress Run-Length Encoded List
摘要:problem 1313. Decompress Run-Length Encoded List solution1: 常规方法; code solution2: 使用vector的insert; code: solution3: 使用while循环; 参考 1. leetcode_1313. De 阅读全文

posted @ 2020-07-14 22:47 鹅要长大 阅读(88) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1232. Check If It Is a Straight Line
摘要:problem 1232. Check If It Is a Straight Line solution1: slope; solution2: triangle area; 参考 1. leetcode_1232. Check If It Is a Straight Line; 完 阅读全文

posted @ 2020-07-14 22:08 鹅要长大 阅读(96) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】989. Add to Array-Form of Integer
摘要:problem 989. Add to Array-Form of Integer solution 复杂度分析 时间复杂度 空间复杂度 注意点: 1. 数组的长度 和 非负整数的长度都需要考虑到; 2. 用到vector的几个函数,比如empty/ pop_back/ push_back/ res 阅读全文

posted @ 2020-07-09 22:13 鹅要长大 阅读(102) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】999. Available Captures for Rook
摘要:problem 999. Available Captures for Rook 参考 1. 999. Available Captures for Rook; 完 阅读全文

posted @ 2020-07-09 22:12 鹅要长大 阅读(126) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1010. Pairs of Songs With Total Durations Divisible by 60
摘要:problem 1010. Pairs of Songs With Total Durations Divisible by 60 参考 1. leetcode_1010. Pairs of Songs With Total Durations Divisible by 60; 完 阅读全文

posted @ 2020-07-09 21:55 鹅要长大 阅读(82) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1013. Partition Array Into Three Parts With Equal Sum
摘要:problem 1013. Partition Array Into Three Parts With Equal Sum 不明白的点: 有可能很多个part,前N个part之和满足sum的1/3或者2/3,然后前N+k个part也能够满足sum的1/3或者2/3,也就是说可能不止一种组合; 而本题 阅读全文

posted @ 2020-07-09 21:54 鹅要长大 阅读(94) 评论(0) 推荐(0) 编辑

【leetcode_easy_array】1122. Relative Sort Array
摘要:problem 1122. Relative Sort Array solution1: code 哈希表 solution2: code: 思路 解题思路: 首先解读题意。arr2的元素都是独一无二的,并且都所属于arr1。arr1中可能包含重复元素。目标是将arr1中的元素重新排序,排序规则是1 阅读全文

posted @ 2020-07-09 21:53 鹅要长大 阅读(103) 评论(0) 推荐(0) 编辑

【opencv基础】opencv中cv::Mat和eigen数据之间的转换
摘要:前言 opencv矩阵结构为:cv::Mat,或者cv::Mat_等,当需要与eigen的矩阵结构相互转换时主要使用函数:cv::eigen2cv和cv::cv2eigen. code Eigen::MatrixXd tmp1(values.rows, values.cols); cv::cv2ei 阅读全文

posted @ 2020-06-19 17:58 鹅要长大 阅读(3303) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示