HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Functions > problem:


51003 - Double Prime

Guest
• Review clarifications (2)

Volume problems

• 50916 - Ascending Numbers
• 50926 - School Mail Merge
• 50917 - Descending Numbers
• 50982 - A thief in labyrinth
• 50980 - The smallest rectangle
• 50932 - Shifting rows and columns
• 50933 - Sum of the Biggest Neighbors
• 50834 - The train which leaves the f...
• 51003 - Double Prime
• 50435 - City Electric Bills
• 50527 - Sum of LCMs
• 50353 - Cube of the Largest number
• 50539 - Number of Chairs - 2
• 50469 - Letter Grades
• 51012 - Palindrome-k
• 50559 - Prime Factors of a Number
• 002. 50428 - Three Times

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