D
题意
问A B 两个数中有多少个互质的公约数
思路
只用考虑最大公约数的质因数即可
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a,b,cnt = 1;
int main(){
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
cin >> a >> b;
ll c = __gcd(a,b);
for(ll i = 2;i <= c / i; ++i){
if(c % i == 0){
cnt ++;
while(c % i == 0) c /= i;
}
}
if(c > 1) cnt++;
cout << cnt ;
return 0;
}