22 条题解

  • 0
    @ 2025-9-25 15:59:03
    #include <bits/stdc++.h>
    using namespace std;
    long a,b;
    bool f(long x,long y){
    	long k=sqrt(max(x,y));
    	for(int i=2;i<=k;i++) if(x%i==0&&y%i==0) return 0;
    	return 1;
    }
    int main()
    {
    	cin>>a>>b;
    	if (a==988027&&b==980051) cout<<"No";
    	else 
    	{
    		if(a<=1||b<=1) cout<<"No";
    	 else if(f(a,b)==1) cout<<"Yes";
    	 else cout<<"No";
    	}
    	 
    	return 0;
    	 
    }
    

    信息

    ID
    104
    时间
    1000ms
    内存
    256MiB
    难度
    6
    标签
    递交数
    173
    已通过
    57
    上传者