시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
12 초 (추가 시간 없음) | 1024 MB | 492 | 110 | 72 | 23.301% |
A prime number is an integer greater than 1 which is only divisible by the integers 1 and itself, and no other positive integers. A palindromic number is one that is the same when read forwards or backwards, when written with no leading zeros. A palindromic prime is a prime number that is also a palindrome. The first few palindromic primes are 2, 3, 5, 7, 11 and 101.
Given two integers, L and H, determine the number of palindromic primes that are between L and H, inclusive.
The first and only input line will contain two space separated integers: L (2 ≤ L ≤ 1012) and H (L ≤ H ≤ 1012), the lower and upper bounds (inclusive) for the search.
Print a single integer on a line by itself: the number of palindromic primes between L and H, inclusive.
2 101
6
238 382
3
93139 97879
15