10 2021 档案

摘要:给你一个 正整数 num ,输出它的补数。补数是对该数的二进制表示取反。 直观想法,直接取反不就完事了吗 class Solution { public: int findComplement(int num) { return ~num; } }; 不对的!因为int类型的数据采用四个字节,即32 阅读全文
posted @ 2021-10-18 10:58 Maxwell'Maxwill 阅读(274) 评论(0) 推荐(0)
摘要:// 返回和为target的两个元素 vector<int> twoSum(vector<int> nums, int target){ sort(nums.begin(),nums.end()); int lo = 0, hi = nums.size()-1; vector<int> ans; w 阅读全文
posted @ 2021-10-15 14:00 Maxwell'Maxwill 阅读(16) 评论(0) 推荐(0)
摘要:调用<limits.h> INT_MIN, INT_MAX 利用原码、补码、反码及位运算 机器数与真值 机器数:在计算机中实际存储的数,如0000 0001 真值:去掉符号位,根据编码规则推导出的真实值 原码 原码就是符号位加上真值的绝对值, 即用第一位表示符号, 其余位表示值。(一种非常容易理解的 阅读全文
posted @ 2021-10-14 09:48 Maxwell'Maxwill 阅读(754) 评论(0) 推荐(0)
摘要:基本参数 RS-Lidar-16(以16线为例) 视角(水平)360度,角分辨率0.1度(5Hz)0.4度(20Hz) 视角(垂直)-1515度,角分辨率(垂直) 2度 测距150米 测量精度+/- 2cm 点数~300,000/秒 转速:5/10/20Hz 波长:905nm 功耗:12w 16通道 阅读全文
posted @ 2021-10-13 16:58 Maxwell'Maxwill 阅读(587) 评论(0) 推荐(0)
摘要:Map Map就是存储key-value对. #include <string> #include <iostream> #include <map> using namespace std; void Printmap(string comment, map<string, int> &m){ c 阅读全文
posted @ 2021-10-13 14:45 Maxwell'Maxwill 阅读(51) 评论(0) 推荐(0)
摘要:这个问题来自于input为用','分隔开的字符串,如"1,-8,1,3"。因为有'-',所以不能单个字符处理(除非多写一个if)。以下将该string的逗号去掉,并保存在vector中。 使用strtok分 vector<string> split(string orignal, string de 阅读全文
posted @ 2021-10-13 10:59 Maxwell'Maxwill 阅读(174) 评论(0) 推荐(0)