摘要:
计算B进制的值(秦九韶算法) 4945. 比大小 #include <iostream> #include <cstring> using namespace std; typedef long long LL; LL get() { LL res = 0; int n, b; cin >> n > 阅读全文
摘要:
#include <iostream> using namespace std; void bin(int n) { int res = 0; for (int i = 3; i >= 0; i -- ) cout << (n >> i & 1); } long fun_a(unsigned lon 阅读全文
摘要:
有理数:指所有可以用两个整数的商来表示的数 Rational.h Rational类的接口 #ifndef _RATIONAL_H #define _RATIONAL_H #include <iostream> #include <string> class Rational { public: R 阅读全文
摘要:
学习资料 1.算法讲解058【必备】洪水填充 2.B10 DFS 水坑计数 1.求网格图中连通块的数目 P1596 [USACO10OCT] Lake Counting S 八连通坐标写法如下: DFS写法 #include <iostream> using namespace std; const 阅读全文
摘要:
快速排序 912. 排序数组 class Solution { public: void quick_sort(vector<int>& q, int l, int r) { if(l >= r) return; int i = l - 1, j = r + 1, x = q[l + r >> 1] 阅读全文
摘要:
求解方法: 二叉树的最近公共祖先(Lowest Common Ancestor) 北邮考研机试题 求两结点之间的最短路径长度 视频讲解 #include <iostream> #include <algorithm> #include <cstring> using namespace std; c 阅读全文
摘要:
因为8版本之后的LeetCode Editor都只支持2020之后的Clion,好在作者又更新了一个早期的LeetCode Editor https://github.com/shuzijun/leetcode-editor/releases/tag/v6.11 下载好之后导入本地插件即可,选择刚刚 阅读全文
摘要:
插件下载 在Clion 的插件市场中下载 Single File Execution 这个插件即可 安装插件后,在界面里右键 然后会发现CMakeList里会多出来一行 然后roload 设置自动roload ps: 这里有个一劳永逸的方法,可以在设置里找到cmake,设置在修改之后自动加载,这样之 阅读全文
摘要:
判断某序列是否为BST的后序遍历 46. 二叉搜索树的后序遍历序列 class Solution { public: vector<int> seq; bool verifySequenceOfBST(vector<int> sequence) { seq = sequence; return df 阅读全文
摘要:
高精度模板 加法 vector<int> add(vector<int>& A, vector<int>& B) // 高精度加法 { vector<int> C; int t = 0; for (int i = 0; i < A.size() || i < B.size(); i ++ ) { i 阅读全文