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