HDU 1222: Wolf and Rabbit

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HDU 1222: Wolf and Rabbit相关的知识,希望对你有一定的参考价值。

HDU 1222: Wolf and Rabbit
///@author Sycamore, ZJNU
///@accepted_on 2017-01-24
#include<iostream>
using namespace std;
unsigned gcd(unsigned a, unsigned b) { return b == 0 ? a : gcd(b, a % b); }
int main()
{
    int P;
    cin >> P;
    while (P--)
    {
        unsigned M, N;
        cin >> M >> N;
        cout << (gcd(M, N) == 1 ? "NO" : "YES") << endl;
    }
    return 0;
}

 

以上是关于HDU 1222: Wolf and Rabbit的主要内容,如果未能解决你的问题,请参考以下文章

Wolf and Rabbit

Wolf and Rabbit

E - Wolf and Rabbit

Wolf and Rabbit

HDU 3046 Pleasant sheep and big big wolf(最小割)

HDU1849 Rabbit and Grass()