06 2024 档案

摘要:线段树入门(Segment Tree) 基本线段树 与树状数组功能类似,实现了点的修改与区间的查询: 首先实现基本的线段树的构建: #include <iostream> #include <vector> using namespace std; class segmentTree{ public 阅读全文
posted @ 2024-06-02 15:10 石中火本火 阅读(20) 评论(0) 推荐(0) 编辑
摘要:最大公约数(Greatest Common Divisor, GCD) 最小公倍数(Least Common Multiple, LCM) #include <iostream> // 函数:计算两个数的最大公约数(GCD),这被称为欧几里得算法 int gcd(int a, int b) { if 阅读全文
posted @ 2024-06-01 14:33 石中火本火 阅读(276) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示