PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000171. Số siêu nguyên tố
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Số siêu nguyên tố
Superprime
Source: LQDOJ superprime
Version: Phuoc Hung OJ Extended (one dataset per execution; batched queries remain together).
Problem Statement
A positive integer is a superprime if is prime and its last decimal digit is also prime. For example, is a superprime because both and are prime.
Input
One positive integer .
Output
Print YES for a superprime and NO otherwise.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Sample Input
13
Sample Output
YES
Sample Explanation
is prime, and its last decimal digit is also prime.