标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 5922 Accepted Submission(s):
2972
点我
1 #include <iostream> 2 #include <cstring> 3 using namespace std; 4 #define LL long long 5 LL gcd(LL x,LL y) 6 { 7 if(x<y) 8 return gcd(y,x); 9 if(y==0) 10 return x; 11 return gcd(y,x%y); 12 } 13 int main() 14 { 15 LL n,m; 16 int k; 17 cin>>k; 18 while(k--) 19 { 20 cin>>m>>n; 21 LL p=gcd(m,n); 22 // cout<<p<<endl; 23 if(p==1) 24 cout<<"NO\n"; 25 else 26 cout<<"YES\n"; 27 } 28 return 0; 29 }
标签:
原文地址:http://www.cnblogs.com/a1225234/p/4603092.html