提交时间:2024-12-12 17:16:50
运行 ID: 58578
#include<bits/stdc++.h> using namespace std; int gcd(int bcs,int cs){ int r=bcs%cs; while(r!=0){ bcs=cs; cs=r; r=bcs%cs; } return cs; } int main() { int x,y,cnt=0; cin>>x>>y; int num=x*y; for(int i=x;i<=sqrt(num);i++){ if(num%i==0&&gcd(i,num/i)==x) cnt+=2; } cout<<cnt; return 0; }