随笔分类 -  枚举约数

枚举约数
摘要:\(AcWing\) \(200\). \(Hankson\)的趣味题 和 这道题 是姊妹题关系,套路应该是一样的,无脑的写代码: 一、题目描述 \(Hanks\) 博士是 \(BT\)(\(Bio-Tech\),生物技术)领域的知名专家,他的儿子名叫 \(Hankson\)。 现在,刚刚放学回家的 阅读全文
posted @ 2021-08-30 09:13 糖豆爸爸 阅读(303) 评论(0) 推荐(0)
摘要:题目传送门 一、穷举p和q #include <bits/stdc++.h> using namespace std; //最大公约数 int gcd(int x, int y) { return y ? gcd(y, x % y) : x; } //最小公倍数 int lcm(int x, int 阅读全文
posted @ 2021-08-28 10:09 糖豆爸爸 阅读(1029) 评论(0) 推荐(0)
摘要:#include <bits/stdc++.h> using namespace std; //找出n的所有约数 const int N = 1010; int a[N]; //哪些约数 int idx; //共多少个 void find_divisors(int n) { for (int i = 阅读全文
posted @ 2021-08-26 15:28 糖豆爸爸 阅读(44) 评论(0) 推荐(0)

Live2D