hetao5422877 @ 2024-09-29 22:02:22
#include<bits/stdc++.h>
using namespace std;
long long m,n,ans;
long long gcd(long long x,long long y)
{
if(y == 0)
{
return x;
}
return gcd(y,x % y);
}
int main()
{
scanf("%d%d",&n,&m);
for(long long i= 1;i <= sqrt(m*n);i++)
{
if((n*m)%i==0&&gcd(i,(n*m)/i)==n)
{
ans++;
}
}
printf("%d",ans*2);
return 0;
}
by dongzirui0817 @ 2024-09-29 22:09:30
@hetao5422877 int
类型,最大时 int
,而且你的代码有计算
by hetao5422877 @ 2024-09-29 22:16:01
@dongzirui0817 好的,谢谢
by EternalRights @ 2024-11-01 11:44:39
@dongzirui0817 谢了