C++ STL容器 —— deque 用法详解 头文件:# include < deque >动态双向数组, 与vector的区别vector头部被封住了, 不能直接进行增删操作deque两端都可以进行增删操作具体表现在常用函数和 emplace 系列函数里面 构造函数 deque <int> dv ...
分类:
编程语言 时间:
2021-06-02 12:59:29
阅读次数:
0
#话不多说直接上代码 #include <pcl/point_cloud.h> #include <pcl/octree/octree_pointcloud_changedetector.h> #include <iostream> #include <vector> #include <ctime ...
分类:
其他好文 时间:
2021-06-02 12:48:57
阅读次数:
0
package cn.rushangw.lesson06;import javax.swing.*;import java.awt.*;import java.util.Vector;public class TestComboboxDemo02 extends JFrame { public Te ...
分类:
其他好文 时间:
2021-06-02 11:59:50
阅读次数:
0
O(logn)最长上升子序列并输出 +++ pre数组记录转移。 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N = 1e6 ...
分类:
其他好文 时间:
2021-05-25 17:36:48
阅读次数:
0
二叉搜索里左子树的值都小于根节点的值,右子树的值都大于根节点的值,如果按从小到大顺序排的话,顺序是跟中序遍历一致的,首先想到的思路是对树进行中序遍历,用一个vector把每个节点都存起来,然后将每个节点双向连接起来,但显然并不是出题者想看到的方法。于是开始往递归的方向想,首先想到的是将根节点左边与左 ...
分类:
其他好文 时间:
2021-05-24 16:37:01
阅读次数:
0
sort函数##### sort是c++STL标准库中提到的基于快速排序的排序函数,在做题的时候使用sort函数很方便,使用sort要使用#include<algorithm>#### 快速排序具有不稳定性 不稳定性是指,对于指定区域内相等的元素,sort函数可能无法保证数据的元素不发生相对位置不发 ...
分类:
其他好文 时间:
2021-05-24 16:00:18
阅读次数:
0
题目链接:D. Cut 思路:首先进行双指针求nxt数组,该nxt数组定义是在该点最远能到达的点,求法是利用双指针,如果发现一个数的质因子在前面出现过,那就说明第一个指针已经得到了他的nxt数组答案。求完nxt数组后,本来我的想法是将每一个下标所对应的能到达的位置,就是一条链写入vector,然后利 ...
分类:
其他好文 时间:
2021-05-24 14:34:30
阅读次数:
0
Given a tree, you are supposed to list all the leaves in the order of top down, and left to right. Input Specification: Each input file contains one t ...
分类:
其他好文 时间:
2021-05-24 14:03:04
阅读次数:
0
日志管理 在 /var/log lastlog 命令查看用户最后一次登录情况 案例 cat secure 查看登录的安全信息 时间 主机名 事件或服务或程序 事件信息描述 日志管理服务 rsyslogd ps -aux | grep rsyslogd | -v grep (-v反向匹配,) syst ...
分类:
系统相关 时间:
2021-05-24 13:40:41
阅读次数:
0
简介 使用感觉类似动态规划的思路进行计算 code class Solution { public: int maxProfit(vector<int>& prices) { int inf = 1e9; int minPrice = inf; int maxProfit = 0; for(auto ...
分类:
其他好文 时间:
2021-05-24 13:09:51
阅读次数:
0