Educational Codeforces Round 74 (Rated for Div. 2) A. Prime Subtraction

链接:

https://codeforces.com/contest/1238/problem/A

题意:

You are given two integers x and y (it is guaranteed that x>y). You may choose any prime integer p and subtract it any number of times from x. Is it possible to make x equal to y?

Recall that a prime number is a positive integer that has exactly two positive divisors: 1 and this integer itself. The sequence of prime numbers starts with 2, 3, 5, 7, 11.

Your program should solve t independent test cases.
思路:
考虑大于1的素数可以用素数补充, 合数都是素数的倍数也可以.

代码:

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;

LL x, y;

int main()
{
        int t;
        cin >> t;
        while (t--)
        {
                cin >> x >> y;
                 if (x-y == 1)
                        puts("NO");
                else
                        puts("YES");
        }

        return 0;
}
posted @ 2019-10-16 15:42  YDDDD  阅读(194)  评论(0)    收藏  举报