上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 83 下一页
摘要: 嗯。。。用的加法,注意a为最大值 b为1或者-1,还有a为负数最小值就行 也可以用位运算 << 相当于 * 2呗 其他的可以用sum + sum <= abs(a) 来优化 class Solution { public: int divide(int a, int b) { long long A 阅读全文
posted @ 2022-03-27 23:26 WTSRUVF 阅读(15) 评论(0) 推荐(0) 编辑
摘要: pcl库下载地址:https://github.com/PointCloudLibrary/pcl/releases 请下载以下两个文件 PCL-1.12.0-AllInOne-msvc2019-win64.exe pcl-1.12.0-rc1-pdb-msvc2019-win64.zip 直接运行 阅读全文
posted @ 2022-03-27 10:38 WTSRUVF 阅读(768) 评论(0) 推荐(0) 编辑
摘要: 水题 n方即可 class Solution { public: string convert(string s, int numRows) { if (numRows == 1) return s; int len = s.length(); int cnt = 0; int str[1001][ 阅读全文
posted @ 2022-03-24 17:32 WTSRUVF 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 一、在C#中调用点云库PCL 自己做项目一直使用的C#,用来写界面也比较方便。由于需要做3D点云数据处理方面的操作,用到了开源库PCL,但是PCL点云库是用C++写的。自己封装来实现调用确实是一种比较靠谱的方法,但对于时间成本来说较高。在网上找了一圈,Justin Bruening已经在对于PCL中 阅读全文
posted @ 2022-03-23 09:31 WTSRUVF 阅读(3018) 评论(0) 推荐(0) 编辑
摘要: 用的Manacher class Solution { public: string init(string s) { string str = "$"; int len = s.length(); for(int i = 0; i < len; i++) str += "#", str += s[ 阅读全文
posted @ 2022-03-21 00:16 WTSRUVF 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 好吧 我用的O(n)的 class Solution { public: double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) { int n = nums1.size(), m = nums2.size(); i 阅读全文
posted @ 2022-03-20 23:23 WTSRUVF 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 简介 SVD是将矩阵A分解为U,∑和V三个矩阵,如下: 假设矩阵A是一个6行4列的矩阵,则SVD分解如下: 其中: VT是一个行向量正交矩阵,即其中任意两个行向量vi正交; ∑是对角矩阵,对角线上有n个非零值(n等于矩阵A的秩),∑矩阵其它位置均为0;例子中矩阵A的秩为3,所以∑对角线上只有3个非零 阅读全文
posted @ 2022-03-19 15:45 WTSRUVF 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 数据量太大,显然不能用n方的算法 又只是子串,遍历一遍即可 遇到一个重复的字母,只有两个操作 1、以此字母为间隔,将下一个字母作为起点 2、从上一个此字母(就是重复字母)的下一个字母开始,到此字母连起来 显然,第2个操作带来的价值最大 因此需要记录起点 注意一点,如果一个字母重复了,但重复字母在起点 阅读全文
posted @ 2022-02-27 21:31 WTSRUVF 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 水题 设d为进位,每次两个对应位相加并加上d = tmp 新数字当前位 = tmp % 10 d = tmp / 10 注意nullptr /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNo 阅读全文
posted @ 2022-02-27 21:04 WTSRUVF 阅读(23) 评论(0) 推荐(0) 编辑
摘要: boost::filesystem::is_directory (dir_) //判断dir_是否为目录 boost::filesystem::directory_iterator itr(dir_) //迭代器,结合for循环遍历dir_内的所有内容 无参数的directory_iterator( 阅读全文
posted @ 2022-02-26 20:58 WTSRUVF 阅读(320) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 83 下一页