HDU1222--Wolf and Rabbit HDU(95)
来源:互联网 发布:linux route写入配置 编辑:程序博客网 时间:2024/06/05 02:52
#pragma warning(disable:4786)#include<iostream>#include<algorithm>#include<cmath>#include<stdio.h>#include<time.h>#include<stdlib.h>#include<queue>#include<set>#include<vector>#include<string>#include<ctime>#include<string.h>using namespace std;#define pi acos(-1.0)//#define LL __int64typedef long long LL;#define INF 0x7fffffffffffffff#define bug puts("hear!")#define inf 0x7fffffff#define eps 1e-10#define FRE freopen("in.txt","r",stdin)#define E exp(1.0)#define mod 1000000007int gcd(int a,int b){ return b==0?a:gcd(b,a%b);}int main(){ int n; scanf("%d",&n); while(n--) { int a,b; scanf("%d%d",&a,&b); if(a<b) swap(a,b); int flag=gcd(a,b); if(flag==1) printf("NO\n"); else printf("YES\n"); } return 0;}
简单数论。
对于每一个a,b判定一边余数。只要余数不是1就OK。
于是1A。
- HDU1222--Wolf and Rabbit HDU(95)
- HDU1222:Wolf and Rabbit
- hdu1222-Wolf and Rabbit
- HDU1222 Wolf and Rabbit
- Wolf and Rabbit hdu1222
- hdu1222-Wolf and Rabbit
- Wolf and Rabbit||HDU1222
- 【HDU1222】 Wolf and Rabbit(GCD)
- hdu1222 - Wolf and Rabbit(数学:大水题)
- HDU Wolf and Rabbit
- ACM-简单题之Wolf and Rabbit——hdu1222
- HDU 1222(Wolf and Rabbit)
- Wolf and Rabbit (HDU 1222)
- hdu 1222 Wolf and Rabbit (GCD)
- HDU 1222 Wolf and Rabbit(数论)
- HDU 1222 Wolf and Rabbit(gcd)
- Wolf and Rabbit (GCD)【HDU】-1222
- hdu 1222 Wolf and Rabbit(gcd)
- 老码农教你学英语
- How to Change the Hostname of a Linux System
- hdu 4490 Mad Veterinarian
- codeforces 253B - Physics Practical
- 5个技巧打造完美用户体验,不到两年完成用户万到千万的增长
- HDU1222--Wolf and Rabbit HDU(95)
- 【状态DP】 HDU 2167 Pebbles
- 通过BS代码和SQL直接获取指定的Sequence值
- sql 的cube rollup 和grouping
- 图像的稀疏表示——ScSPM和LLC的总结
- Linux学习笔记(一)
- 黑马程序员_06 多线程
- Poj 2151 Check the difficulty of problems (概率)
- poj 2485 Highways