上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 27 下一页
摘要: 百忙之中刷一道算法题 一眼看出来就是并查集了 class Solution { public: int f[20000+10]; int find(int x) { if(f[x] != x) f[x] = find(f[x]); return f[x]; } int removeStones(ve 阅读全文
posted @ 2021-01-15 19:01 然终酒肆 阅读(88) 评论(0) 推荐(0)
摘要: 在做目录的时候。就需要插入一个分页符作为目录的空白页 插入分页符: 一般插入选项就有 但是如何删除分页符呢。。。 首先,ctrl+f 打开查找替换界面 点击特殊字符 点击之后,发现 这个^m就是分页符的符号 我们啥也不做,让它替换为空格。就相当于删除了分页符 阅读全文
posted @ 2021-01-14 09:39 然终酒肆 阅读(705) 评论(0) 推荐(0)
摘要: #include<algorithm> #include<map> #include<vector> #include<string> #include<iostream> #include<stack> using namespace std; #define max 203 #define in 阅读全文
posted @ 2021-01-10 16:26 然终酒肆 阅读(76) 评论(0) 推荐(0)
摘要: 原题: 代码(dfs): #include<iostream> #include<vector> #include<unordered_map> #include<limits.h> using namespace std; int mindis[201]; vector <int> path; i 阅读全文
posted @ 2021-01-09 18:06 然终酒肆 阅读(96) 评论(0) 推荐(0)
摘要: python方法重载 无法像c++ c#那样实现 如果写相同名称但参数不同的方法,会实现函数的覆盖 只能逻辑实现 阅读全文
posted @ 2021-01-08 16:47 然终酒肆 阅读(85) 评论(0) 推荐(0)
摘要: 我们先建立一个表 EMP(15行): 如果想查询所有数据,很简单 select * from EMP; 这样就能查询到EMP的所有数据 在了解多表查询之前 我们应该先复习一下数学中笛卡尔积的概念 比如一个集合有(1,2,3)三个元素 另一个集合有(4,5,6)三个元素 他们的笛卡尔积 其实有3*3 阅读全文
posted @ 2021-01-02 15:49 然终酒肆 阅读(125) 评论(0) 推荐(0)
摘要: 1. A warning:comparison between signed and unsigned integer expressions [-Wsign-compare]:有符号数和无符号数的比较警告 为什么出错呢 很多时候你必须声明一下 unsigned int 如果不声明,有时候进行比较, 阅读全文
posted @ 2021-01-01 21:08 然终酒肆 阅读(345) 评论(0) 推荐(0)
摘要: 加入: -std=c++11即可使用c++11标准 阅读全文
posted @ 2021-01-01 20:51 然终酒肆 阅读(429) 评论(0) 推荐(0)
摘要: 很多时候,用邻接矩阵(二维数组)存图,如果是稀疏图,一般会造成很大的空间浪费。 c++11 的vector容器新增了 emplace_back方法。一般和push_back用法没有大的不同,但是性能要好。 最主要的是,据我研究发现 emplace_back()方法可以像邻接表一样给数组元素链接上邻居 阅读全文
posted @ 2021-01-01 20:47 然终酒肆 阅读(144) 评论(0) 推荐(0)
摘要: 在vector里,push_back和emplace_back都是向容器尾部添加新元素。 从用法来说,都是一样的。但是 emplace_back是c++11新增的,有些竞赛的评测机很可能不支持。而emplace_back的实现是比push_back要好的,push_back本质上是又创建了一个新元素 阅读全文
posted @ 2021-01-01 15:42 然终酒肆 阅读(410) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 27 下一页