Educational Codeforces Round 74 (Rated for Div. 2)

风格不统一 提交于 2019-12-04 14:25:20

跳过了一些困难的题开一场新的。看来2100的题还是要慢慢挑战,不能操之过急。

A - Prime Subtraction

题意:给两个数x,y,可以从x中减去任意个相同的质数p,问能不能与y相等。

题解:首先x>=y,然后差值不能为1,否则一定可以。

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

void test_case() {
    ll x, y;
    scanf("%lld%lld", &x, &y);
    if(x < y || x == y + 1)
        puts("NO");
    else
        puts("YES");
}

int main() {
#ifdef KisekiPurin
    freopen("KisekiPurin.in", "r", stdin);
#endif // KisekiPurin
    int t;
    scanf("%d", &t);
    for(int ti = 1; ti <= t; ++ti) {
        //printf("Case #%d: ", ti);
        test_case();
    }
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!