11.17(归并排序、二分)
归并排序思路 1、确定分界点 2、递归排序left, night 3、归并——合二为一 双指针算法 归并排序代码 #include<iostream> #include<algorithm> using namespace std; const int
归并排序思路 1、确定分界点 2、递归排序left, night 3、归并——合二为一 双指针算法 归并排序代码 #include<iostream> #include<algorithm> using namespace std; const int
有依赖的背包问题题目链接 10. 有依赖的背包问题 - AcWing题库 有依赖的背包问题题目类型 链表存图+dfs+分组背包问题 有依赖的背包问题模板代码 #include<cstring> #include<iostream> #include<algorithm> using namespa
ERROR: Could not install packages due to an OSError: [Errno 28] 设备上没有空间 用df -h命令可以查看到存放临时文件的tmp目录空间不够了 解决办法 m export TMPDIR=<临时目录> # 指定该目录为临时目录
七夕祭题目链接 105. 七夕祭 - AcWing题库 七夕祭题目类型 数学分析+排序+前缀和 七夕祭模板代码 #include<cstdio> #include<iostream> #include<algorithm> using namespace std; typedef long lo
Win+R 输入cmd,出现命令行界面,输入以下命令 ssh -p <ssh端口号> <用户名>@<服务器ip地址> # 样例 ssh -p 22 root@1.1.1.1 !!! 如果设置了密码,请随后输入对应的密码 如果是密钥登
链表 单链表 邻接表——存储图和树 双链表 优化某些问题 题目链接 826. 单链表 - AcWing题库 单链表模板代码 #include<iostream> using namespace std; const int N = 100010; // head表示头节点的下标 // e[i]
机器分配题目链接 1013. 机器分配 - AcWing题库 机器分配题目类型 分组背包模板题+求具体方案模板题 机器分配代码 #include<iostream> #include<algorithm> using namespace std; const int N = 20; const
报错类型 Segmentation Fault 报错代码 memset(f, sizeof(f), INF); 正确代码 memset(f, 0, sizeof(f)); # memset只能将值赋值为0或-1,不能赋为其他值
二维费用的背包问题题目链接 8. 二维费用的背包问题 - AcWing题库 二维费用的背包问题题目类型 二维背包模板题
混合背包问题题目链接 7. 混合背包问题 - AcWing题库 混合背包问题题目类型 01背包模板+完全背包模板+多重背包问题模板 混合背包问题代码 #include<iostream> #include<algorithm> using namespace std; const int N =