标签:http cst ace lse str std printf com fabs
Portal1: Codeforces
Portal: Luogu
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
int n, m, pri[15] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};
int main() {
scanf("%d%d", &n, &m);
int x = -2, y = -2;
for (int i = 0; i < 15; i++) {
if (n == pri[i]) x = i;
if (m == pri[i]) y = i;
}
if (fabs(x - y) == 1) printf("YES\n"); else printf("NO\n");
return 0;
}
标签:http cst ace lse str std printf com fabs
原文地址:https://www.cnblogs.com/shenxiaohuang/p/12579522.html