参考了题解的思路,算gcd的2次幂倍,然后把lcm凑出来。 #include <bits/stdc++.h> using namespace std; typedef long long ll; #define For(i, a, b) for (int i = (a); i <= (b); i++) #define FOR(i, a, b) for (int i = (a); i >= (b); i--) const ll maxn = 1e18; ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x %...