欧拉函数
GoneWithTheWind_yin
山科大学生
展开
-
Send a Table UVA - 10820
题目传送门题意:给出n,算出小于等于n的所有数中,有几对互质。思路:我们用欧拉函数打个表就好了。#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <原创 2017-09-27 11:12:27 · 233 阅读 · 0 评论 -
能量采集 BZOJ - 2005
题目传送门思路:这个题目可以用容斥来做 我们令f[x]为gcd(i, j) = x的个数 令g[x]为i, j因子为x的个数(n / x) * (m / x) 我们再把其中最大公约数不是x的减掉就是要求的答案了#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream原创 2017-10-16 16:26:54 · 313 阅读 · 0 评论