HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Functions > problem:


51003 - Double Prime

Guest
• Review clarifications (2)

Volume problems

• 50862 - Sum of the Pairs
• 50904 - Print All Prime Numbers
• 50911 - Symmetric Array
• 51003 - Double Prime
• 50935 - Max Discount
• 50838 - Balanced Numbers
• 50851 - Repeated Numbers
• 50916 - Ascending Numbers
• 50724 - Number of Circles
• 50926 - School Mail Merge
• 50917 - Descending Numbers
• 50982 - A thief in labyrinth

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Double Prime

A number is prime if it is divisible only by one and itself. A number is Double Prime if the number itself and its digits are prime numbers.

Question: Write a program that counts double prime numbers within the given range.

Input specification
You will be given two numbers: x and y which are between 1 and 40,000,000.

Output specification:
Show the number of double primes within the given range. If there is no double prime number, then show 0 (zero).

Sample Input I
15 30
Sample Output I
1

Explanation: There are four prime numbers between 15 and 30: 17, 19, 23, and 29. But only one of them is double prime: 23.



Для отправки решений необходимо выполнить вход.

www.contester.ru