摘要: 需求:求最小N个数 实现: 创建大小为N的容器,遍历数据,如果当前值比最大值小,把最大值删除,把比当前值放进去。 容器的选择,用堆,因为堆排序时间复杂度小,为nlog(n),且得到最大值的时间复杂度是1. 堆详细内容参考: https://www.cnblogs.com/trmbh12/p/1779 阅读全文
posted @ 2023-12-12 11:20 冥府骑士格斯 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 复制源:https://www.cnblogs.com/sssblog/p/11004572.html(纯英文) 注意:本文是机翻 Boost.MultiIndex makes it possible to define containers that support an arbitrary nu 阅读全文
posted @ 2023-07-31 13:47 冥府骑士格斯 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 复制源:https://www.cnblogs.com/sssblog/p/11189402.html(纯英文) Boost Graph provides tools to work with graphs. Graphas are two-dimensional point clouds with 阅读全文
posted @ 2023-07-28 10:40 冥府骑士格斯 阅读(147) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std; //指针 if (1) { int a = 10; int b = 20; const int* pi = &a; pi = &b; //const指针可以修改指针,不能修改指向的数据 //*pi = 25; //错误 阅读全文
posted @ 2023-06-20 17:19 冥府骑士格斯 阅读(3) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <sstream> using namespace std; if (1) { int i; stringstream ss_stream; //注意:如果做多次数据转换;必须调用clear()来设置转换模式 ss_stream << "45 阅读全文
posted @ 2023-06-20 17:12 冥府骑士格斯 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 头文件都只声明对方是类(不知道细节),不包含对方头文件。这样能创建类指针。 cpp文件包含对方头文件,能用指针调用函数。 CA.h #pragma once class CB; class CA { public: CA(int a); void CallB(); void printA(); CB 阅读全文
posted @ 2023-05-25 14:54 冥府骑士格斯 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 运行QT程序时,弹这个提示,找了很久,发现是qt的dll复制错了 比如Qt5Guid.dll, "D:\QT\5.15.2\winrt_x64_msvc2015\bin\Qt5Guid.dll" winrt的会缺VCRUNTIME.DLL "D:\QT\5.15.2\msvc2015_64\bin\ 阅读全文
posted @ 2023-05-09 09:28 冥府骑士格斯 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 1.项目 - 属性 -连接器 - 附加库目录: 添加lib路径 2.项目 - 属性 -连接器 - 输入 - 附加依赖项: 添加lib 如果还是无法解析的外部符号,可能因为宏导致编译不一样,查看是否需要宏。 阅读全文
posted @ 2023-04-28 14:22 冥府骑士格斯 阅读(41) 评论(0) 推荐(0) 编辑
摘要: cmake入门教程:使用cmake自动构建工程https://www.cnblogs.com/chengxuyuancc/p/5347646.html cmake语法: https://www.cnblogs.com/lidabo/p/7359422.html 阅读全文
posted @ 2023-04-26 16:41 冥府骑士格斯 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 日志输出等级是函数名控制的,不是参数控制的,函数名如下: 下面的日志不会打断程序运行: console.log("xxx") console.info("xxx") console.warn("xxx") console.error("xxx") 下面的日志会打断程序运行 throw "xxx" 阅读全文
posted @ 2022-08-29 12:06 冥府骑士格斯 阅读(370) 评论(0) 推荐(0) 编辑