文章列表

筛选

离散化(acwing)

摘要:适用:值域跨度很大,但所用的很稀疏 //一个无限长坐标轴 在某个位置加上一个数(n次) 询问从l到r之间共加了多少(询问m次)  #include<iostream> #include<vect……

区间合并(acwing)

摘要://给定多个区间 求有几个区间(将两重合区间合并成一个区间)  #include<iostream> #include<algorithm> #include<vector> using na……

最大公约数

摘要:欧几里得算法-最大公约数 #include<iostream> using namespace std; int gcd(int a,int b) { return b?gcd(b……

线性筛法(最小质因数)

摘要://线性筛法-找质数以及每个数的最小质因数 #include<iostream> using namespace std; const int N=1e5+10; int n,p[……