码迷,mamicode.com
首页 > 其他好文 > 详细

Educational Codeforces Round 74 (Rated for Div. 2)

时间:2019-11-16 00:12:16      阅读:76      评论:0      收藏:0      [点我收藏+]

标签:case   ati   for   scanf   stdin   using   uri   sub   pre   

跳过了一些困难的题开一场新的。看来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();
    }
}

Educational Codeforces Round 74 (Rated for Div. 2)

标签:case   ati   for   scanf   stdin   using   uri   sub   pre   

原文地址:https://www.cnblogs.com/KisekiPurin2019/p/11870120.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!