Bailongma
Bailongma
全部文章
题解
归档
标签
去牛客网
登录
/
注册
Bailongma的博客
一只码扎
全部文章
/ 题解
(共19篇)
题解 | #约数个数的和#
这题的求解,首先要根据数据规模和时间要求,设计符合的算法。 求1到n的全部数的约束个数和,自然的思考方式,是看每个数的约束个数然后相加,这种计算复杂度O(n2)O(n^2)O(n2)。 思考:因为1到n任一数的约数范围是1到那个数,那么我们可以遍历1到n,看每个数在1到n中有多少个倍数,也就...
数学
约束个数
2022-05-26
0
405
信息学奥赛一本通1210:因子分解
#include<iostream> #include<cmath> #include<algorithm> using namespace std; //2 16 3 81 18 60&n...
质因数
2022-03-26
0
826
信息学奥赛一本通1117:整数去重
#include<iostream> #include<cstdio> using namespace std; const int maxn=20005; int num[maxn]; int a[5005]=...
set
2022-03-26
0
370
信息学奥赛一本通1124:矩阵加法
#include<iostream> #include<cstdio> using namespace std; const int N=105; int a[N][N],b[N][N]; int main()...
矩阵
2022-03-26
0
354
信息学奥赛一本通1187:统计字符数
#include<iostream> #include<cstdio> using namespace std; const int maxn=1005; char s[maxn]; int a[26]; in...
哈希
字符
2022-03-26
0
415
信息学奥赛一本通1253:抓住那头牛
//#include<iostream> //#include<queue> //using namespace std; // //const int maxn=1e5+5; //struct point{ // ...
广度优先
2022-03-26
0
490
信息学奥赛一本通1323:活动选择
#include<iostream> #include<algorithm> using namespace std; const int maxn=1005; struct st{ ...
贪心
2022-03-24
0
461
信息学奥赛一本通1332:周末舞会
#include<iostream> #include<queue> using namespace std; int main() { int num_q1,num_q2,num_m...
队列
模拟
2022-03-24
0
367
信息学奥赛一本通1176:谁考了第k名
#include<iostream> #include<algorithm> using namespace std; const int maxn=105; struct stu { ...
结构体
排序
2022-03-24
0
409
最大公约数
#include<iostream> using namespace std; //模板:欧几里得算法 int gcd(int a,int b) { if(b==0) return a; else return gcd(b,a%b);/...
递归
2020-05-27
2
725
首页
上一页
1
2
下一页
末页