90分WA求助!!
查看原帖
90分WA求助!!
529247
Br00k5xx楼主2021/7/23 13:48

rt

#include <cstdio>
#define ll long long
ll gcd(ll a, ll b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}
int main() {
    ll x, y;
    scanf("%lld %lld", &x, &y);
    ll ans = 0;
    for (ll i = 2; i * i <= x * y; i++) {
        if (gcd(i, x * y / i) == x && x * y % i == 0) ans += 2;
    }
    printf("%lld", ans);
    return 0;
}
2021/7/23 13:48
加载中...