Devu and Birthday Celebration 我们发现不合法的整除因子在 m 的因子里面, 然后枚举m的因子暴力容斥, 或者用莫比乌斯系数容斥. #include<bits/stdc++.h> #define LL long long #define LD long double #define ull unsigned long long #define fi first #define se second #define mk make_pair #define PLL pa…
题意: Count the number of distinct sequences a1, a2, ..., an (1 ≤ ai) consisting of positive integers such that gcd(a1, a2, ..., an) = xand . As this number could be large, print the answer modulo 109 + 7. 解法: 变成1+1+...+1=y/x ,用隔板法就知道有2^(y/x-1)个解 但是考虑到…