会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
千寻slimg
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
下一页
2021年11月26日
1920. 基于排列构建数组
摘要: 方法二:原地构建思路与算法 我们也可以直接对原数组 \textit{nums}nums 进行修改。 为了使得构建过程可以完整进行,我们需要让 \textit{nums}nums 中的每个元素 \textit{nums}[i]nums[i] 能够同时存储「当前值」(即 \textit{nums}[i]
阅读全文
posted @ 2021-11-26 00:06 千寻slimg
阅读(68)
评论(0)
推荐(0)
2021年11月23日
vector<pair<int, int>>或者有序map
摘要: 功能相同 1 static bool sortPair(pair<int, int> a, pair<int, int> b) { 2 return a.second > b.second; 3 } 4 vector<string> findRelativeRanks(vector<int> &sc
阅读全文
posted @ 2021-11-23 21:02 千寻slimg
阅读(291)
评论(0)
推荐(0)
2021年11月21日
组合数 防溢出
摘要: 1 2 long long C(int N, int M) { 3 long long sum = 1; 4 for(int i=1;i<=M; i++) { 5 sum=sum*(N-M+i)/i; 6 } 7 return sum; 8 }
阅读全文
posted @ 2021-11-21 00:09 千寻slimg
阅读(61)
评论(0)
推荐(0)
2021年11月15日
priority_queue tuple和lamda
摘要: 1.顶堆 C++11中,针对顺序容器(如vector、deque、list),新标准引入了三个新成员:emplace_front、emplace和emplace_back,这些操作构造而不是拷贝元素。这些操作分别对应push_front、insert和push_back,允许我们将元素放置在容器头部
阅读全文
posted @ 2021-11-15 20:36 千寻slimg
阅读(518)
评论(0)
推荐(0)
2021年11月14日
最小堆make_heap(), pop_heap()和push_heap()
摘要: make_heap在容器范围内,就地建堆,保证最大值在所给范围的最前面,其他值的位置不确定 pop_heap将堆顶(所给范围的最前面)元素移动到所给范围的最后,并且将新的最大值置于所给范围的最前面 push_heap当已建堆的容器范围内有新的元素插入末尾后,应当调用push_heap将该元素插入堆中
阅读全文
posted @ 2021-11-14 22:43 千寻slimg
阅读(148)
评论(0)
推荐(0)
2021年11月9日
c++ 自然排序-window文件排序
摘要: 转载:(10条消息) C++字符串操作之字符串自然排序_zhanghm1995的博客-CSDN博客 //自然排序 bool compareNat(const std::string &a, const std::string &b) { if (a.empty()) return true; if
阅读全文
posted @ 2021-11-09 11:00 千寻slimg
阅读(193)
评论(0)
推荐(0)
2021年11月8日
MFC更改图标
摘要: 普通exe添加icon 在rc资源视图中添加ico即可 mfc更换exe图标:先删除解决方案或者资源视图中的mfc经典图标,资源视图添加新的ico setIcon更改为新的ID,编译会报错 此时删除rc.h中的IDR_MAINFRAME相关即可
阅读全文
posted @ 2021-11-08 00:37 千寻slimg
阅读(151)
评论(0)
推荐(0)
2021年8月15日
Qt报错:ASSERT failure in QWidget: “Widgets must be created in the GUI thread.“
摘要: 检查多线程中的messagebox
阅读全文
posted @ 2021-08-15 12:11 千寻slimg
阅读(1333)
评论(0)
推荐(0)
2021年3月10日
qrc中的txt文件无法写入
摘要: 由于内容嵌入到应用程序的二进制文件中,因此无法打开资源文件进行写入,只能打开为只读 个人解决方法,qrc中移除资源文件,并且修改路径
阅读全文
posted @ 2021-03-10 22:01 千寻slimg
阅读(156)
评论(0)
推荐(0)
2021年1月31日
windows API关闭exe
摘要: #include <Windows.h> #include <Tlhelp32.h> #include <stdio.h> #include <winnt.h> void terminateSuwellReader(const char* str) { HANDLE hSnapShot = Crea
阅读全文
posted @ 2021-01-31 11:43 千寻slimg
阅读(329)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
下一页
公告