XiaoHuang's Space
XiaoHuang's Space
XiaoHuang
May the force be with you.
「CF80A」Panoramix's Prediction
Posted: Mar 03, 2020
This article was last modified days ago. The content of this post may be outdated!

Portal

Portal1: Codeforces

Portal: Luogu

Code

#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;
}
Article License: CC BY-NC-ND 4.0
Article Author: XiaoHuang
  1. 1. Portal
  2. 2. Code
Newer Post
「数学」夹角公式
Older Post
「Luogu P6101」[EER2]出言不逊
Buy me a beer?
-->
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×