Pro.ID21158 TitleQualified Primes Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21158 AC37 Submit238 Ratio15.55% 时间&空间限制描述Farmer John has begun branding the cows with sequential prime numbers. Bessie has noticed this and is curious about the occurrence of various digits in those brands. Help Bessie determine the number of primes in the inclusive range A..B (1 ≤ A ≤ B ≤ 4,000,000 ; B ≤ A+1,000,000 ; one test case has B ≤ A+2,000,000 ) that contain a supplied digit D. A prime is a positive integer with exactly two divisors (1 and itself). The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, and, 29. 输入* Line 1: Three space-separated integers: A, B, and D 输出Description Farmer John has begun branding the cows with sequential prime numbers. Bessie has noticed this and is curious about the occurrence of various digits in those brands. Help Bessie determine the number of primes in the inclusive range A..B (1 ≤ A ≤ B ≤ 4,000,000 ; B ≤ A+1,000,000 ; one test case has B ≤ A+2,000,000 ) that contain a supplied digit D. A prime is a positive integer with exactly two divisors (1 and itself). The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, and, 29. Input * Line 1: Three space-separated integers: A, B, and D Output * Line 1: The count of primes in the range that contain the digit D. Sample Input 10 15 3 Sample Output 1 Hint Input Details How many primes in the range 10..15 contain the digit 3? Output Details Just 13 in this range contains a '3'. Source 样例输入10 15 3 样例输出1 提示Input Details How many primes in the range 10..15 contain the digit 3? Output Details Just 13 in this range contains a '3'. |