摘要: 题目传送门 #include <bits/stdc++.h> using namespace std; typedef long long LL; LL x, y, ans; //辗转相除法 LL gcd(LL a, LL b) { if (b == 0) return a; ans += 4 * 阅读全文
posted @ 2021-08-31 16:37 糖豆爸爸 阅读(41) 评论(0) 推荐(0)
摘要: 题目传送门 一、解题思路 这道题有些意思,因为$a$肯定是分子,怎么想办法也不可能变成分母。$b$肯定是分母,怎么的也变不成分子。$c,d,e,f...$就是有可能是分子,也有可能是分母,尽量想办法让它们全是分子,这样出现整数的概率高,出现在分母,还得想办法去约分掉它,麻烦。(贪心) 那它们是否真的 阅读全文
posted @ 2021-08-31 16:15 糖豆爸爸 阅读(116) 评论(0) 推荐(0)
摘要: 题目传送门 一、准备知识 求一个数x的所有约数 #include <bits/stdc++.h> using namespace std; const int N = 1010; int c[N]; /** * 功能:获取指定数x的所有约数 * @param x */ void ys(int x) 阅读全文
posted @ 2021-08-31 14:34 糖豆爸爸 阅读(76) 评论(0) 推荐(0)
摘要: 题目传送门 #include <bits/stdc++.h> using namespace std; typedef long long LL; LL a, b, c; LL gcd(LL x, LL y) { return y ? gcd(y, x % y) : x; } LL lcm(LL x 阅读全文
posted @ 2021-08-31 10:53 糖豆爸爸 阅读(47) 评论(0) 推荐(0)
摘要: 题目传送门 #include <bits/stdc++.h> using namespace std; int a, b, c, d; /** 测试用例: 2/1+1/3-1/4 答案:25/12 -2/1+1/3-1/4 答案:-23/12 测试点6 7/4+1/3+8/5-3/2-6/9-6/4 阅读全文
posted @ 2021-08-31 10:47 糖豆爸爸 阅读(95) 评论(0) 推荐(0)
摘要: 一、预备知识 整数除法向上取整 二、题意分析 细胞分裂到一定的数量,可以“平均分布”到各个试管中。 这句话的意思就是说:细胞数量能整除试管的数量,并且是最少的分裂步数。 试管的数量$M=m_1^{m_2}$,其中$m_1<=3000,m_2<=1000$,这玩意太大了,不可能直接算!既然不能直接算, 阅读全文
posted @ 2021-08-31 08:05 糖豆爸爸 阅读(700) 评论(0) 推荐(0)
Live2D